Skip to content

Instantly share code, notes, and snippets.

@LEW21
Created May 5, 2015 16:29
Show Gist options
  • Save LEW21/02cac09a54dcf8ed939f to your computer and use it in GitHub Desktop.
Save LEW21/02cac09a54dcf8ed939f to your computer and use it in GitHub Desktop.
TVP ISM/MP4 URL finder
import requests
import re
import sys
url = sys.argv[1]
prefix, url_id = url.rsplit("/", 1)
id = int(url_id)
player_url = "http://www.tvp.pl/sess/tvplayer.php?object_id=" + url_id
p = requests.get(player_url).text
try:
ism_url = re.search("src\\:'(.*/manifest)'", p).group(1)
except AttributeError:
ism_url = ""
try:
mp4_url = re.search("src\\:'(.*\\.mp4)'", p).group(1)
except AttributeError:
mp4_url = ""
print("ISM URL: " + ism_url)
print("MP4 URL: " + mp4_url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment