mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 00:33:58 +03:00
[videomega] better approach using str.translate()
This commit is contained in:
parent
cb3eded938
commit
56a5e63edb
@ -29,14 +29,8 @@ class Videomega(VideoExtractor):
|
||||
self.title = match1(content, r'<title>(.*)</title>')
|
||||
js = match1(content, r'(eval.*)')
|
||||
t = match1(js, r'\$\("\d+"\)\.\d+\("\d+","([^"]+)"\)')
|
||||
t = re.sub(r'(\w)', r'{\1}', t) \
|
||||
.replace('a', '10') \
|
||||
.replace('b', '11') \
|
||||
.replace('c', '12') \
|
||||
.replace('d', '13') \
|
||||
.replace('e', '14') \
|
||||
.replace('f', '15') \
|
||||
.replace('g', '16')
|
||||
t = re.sub(r'(\w)', r'{\1}', t)
|
||||
t = t.translate({87 + i: str(i) for i in range(10, 36)})
|
||||
s = match1(js, r"'([^']+)'\.split").split('|')
|
||||
self.streams['original'] = {
|
||||
'url': t.format(*s)
|
||||
|
Loading…
Reference in New Issue
Block a user