mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-20 05:47:24 +01:00
Update fptplay.py
This commit is contained in:
parent
698680fc3c
commit
357b639718
@ -38,6 +38,7 @@ class FptplayIE(InfoExtractor):
|
|||||||
'duration': '2665',
|
'duration': '2665',
|
||||||
},
|
},
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
contentId = self._match_id(url)
|
contentId = self._match_id(url)
|
||||||
# Need valid cookie with Bearer token, else it won't work
|
# Need valid cookie with Bearer token, else it won't work
|
||||||
@ -89,6 +90,7 @@ def _real_extract(self, url):
|
|||||||
'title': res['result']['title_origin'] if res['result']['title_origin'] else res['result']['title_vie'],
|
'title': res['result']['title_origin'] if res['result']['title_origin'] else res['result']['title_vie'],
|
||||||
'entries': entries,
|
'entries': entries,
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_api_with_st_token(self, video_id, episode=None):
|
def get_api_with_st_token(self, video_id, episode=None):
|
||||||
if episode is not None:
|
if episode is not None:
|
||||||
path = f'/api/v7.1_w/stream/vod/{video_id}/{0 if episode is None else episode}/adaptive_bitrate'
|
path = f'/api/v7.1_w/stream/vod/{video_id}/{0 if episode is None else episode}/adaptive_bitrate'
|
||||||
@ -98,6 +100,7 @@ def get_api_with_st_token(self, video_id, episode=None):
|
|||||||
t = hashlib.md5(f'6ea6d2a4e2d3a4bd5e275401aa086d{timestamp}{path}'.encode()).hexdigest().upper()
|
t = hashlib.md5(f'6ea6d2a4e2d3a4bd5e275401aa086d{timestamp}{path}'.encode()).hexdigest().upper()
|
||||||
r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
||||||
n = [int(f'0x{t[2 * o: 2 * o + 2]}', 16) for o in range(len(t) // 2)]
|
n = [int(f'0x{t[2 * o: 2 * o + 2]}', 16) for o in range(len(t) // 2)]
|
||||||
|
|
||||||
def convert(e):
|
def convert(e):
|
||||||
t = ''
|
t = ''
|
||||||
n = 0
|
n = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user