Changeset 45650 for titan/mediathek/localhoster/streamtape.py
- Timestamp:
- 12/03/21 13:00:22 (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/mediathek/localhoster/streamtape.py
r45112 r45650 32 32 class StreamTapeResolver(object): 33 33 name = "streamtape" 34 domains = ['streamtape.com' ]35 pattern = r'(?://|\.)(str eamtape\.com)/(?:e|v)/([0-9a-zA-Z]+)'34 domains = ['streamtape.com', 'strtape.cloud', 'streamtape.net', 'streamta.pe', 'streamtape.site', 'strcloud.link'] 35 pattern = r'(?://|\.)(str(?:eam)?(?:tap?e?|cloud)\.(?:com|cloud|net|pe|site|link))/(?:e|v)/([0-9a-zA-Z]+)' 36 36 37 37 # def __init__(self): … … 57 57 headers = {'User-Agent': common.FF_USER_AGENT, 58 58 'Referer': 'https://{0}/'.format(host)} 59 r = self.net.http_GET(web_url, headers=headers) 60 src = re.search(r'''ById\('vi.+?=\s*["']([^"']+)['"].+?["']([^"']+)''', r.content) 59 try: 60 r = self.net.http_GET(web_url, headers=headers).content 61 except urllib_error.HTTPError: 62 # raise ResolverError('Video deleted or removed.') 63 print 'errormsg=Video deleted or removed.' 64 return 65 src = re.findall(r'''ById\('.+?=\s*(["']//[^;<]+)''', r) 61 66 if src: 62 src_url = 'https:{0}{1}&stream=1'.format(src.group(1), src.group(2)) 67 src_url = '' 68 parts = src[-1].replace("'", '"').split('+') 69 for part in parts: 70 p1 = re.findall(r'"([^"]*)', part)[0] 71 p2 = 0 72 if 'substring' in part: 73 subs = re.findall(r'substring\((\d+)', part) 74 for sub in subs: 75 p2 += int(sub) 76 src_url += p1[p2:] 77 src_url += '&stream=1' 78 src_url = 'https:' + src_url if src_url.startswith('//') else src_url 63 79 print helpers.get_redirect_url(src_url, headers) + helpers.append_headers(headers) 64 80 # raise ResolverError('Video cannot be located.') 65 66 # def get_url(self, host, media_id): 67 # return self._default_get_url(host, media_id, template='https://{host}/e/{media_id}') 81 else 82 print 'errormsg=Video cannot be located.' 68 83 69 84 def get_url(self, host, media_id):
Note: See TracChangeset
for help on using the changeset viewer.