Update fptplay.py

This commit is contained in:
MrHulk 2024-09-12 16:32:58 +05:30 committed by GitHub
parent 698680fc3c
commit 357b639718
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,6 +38,7 @@ class FptplayIE(InfoExtractor):
'duration': '2665',
},
}]
def _real_extract(self, url):
contentId = self._match_id(url)
# 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'],
'entries': entries,
}
def get_api_with_st_token(self, video_id, episode=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'
@ -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()
r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
n = [int(f'0x{t[2 * o: 2 * o + 2]}', 16) for o in range(len(t) // 2)]
def convert(e):
t = ''
n = 0