mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-20 05:47:24 +01:00
[RadioFrance] run autopep
This commit is contained in:
parent
dcd0ee3ec3
commit
dda6f7b563
@ -281,9 +281,9 @@ def _extract_embedded_episodes(self, item, webpage, content_id):
|
|||||||
links = item['playerInfo']['media']['sources']
|
links = item['playerInfo']['media']['sources']
|
||||||
item['formats'] = []
|
item['formats'] = []
|
||||||
for linkkey in links:
|
for linkkey in links:
|
||||||
url = self._search_regex(linkkey+r'\.url="([^"]+)";', webpage, content_id)
|
url = self._search_regex(linkkey + r'\.url="([^"]+)";', webpage, content_id)
|
||||||
dur = int(self._search_regex(linkkey+r'\.duration=(\d+);', webpage, content_id))
|
dur = int(self._search_regex(linkkey + r'\.duration=(\d+);', webpage, content_id))
|
||||||
preset = self._search_json(linkkey+r'\.preset=', webpage, content_id, content_id, contains_pattern=r'\{.+\}', transform_source=js_to_json)
|
preset = self._search_json(linkkey + r'\.preset=', webpage, content_id, content_id, contains_pattern=r'\{.+\}', transform_source=js_to_json)
|
||||||
item['formats'].append({
|
item['formats'].append({
|
||||||
'format_id': preset['id'],
|
'format_id': preset['id'],
|
||||||
'url': url,
|
'url': url,
|
||||||
@ -457,7 +457,7 @@ def _call_api(self, station, profile_id, cursor):
|
|||||||
# get the page data
|
# get the page data
|
||||||
pagekey = pagedata['pagination']
|
pagekey = pagedata['pagination']
|
||||||
hasMorePages = False
|
hasMorePages = False
|
||||||
lastPage = int(self._search_regex(pagekey+r'\.lastPage=(\d+);', webpage, profile_id, '0'))
|
lastPage = int(self._search_regex(pagekey + r'\.lastPage=(\d+);', webpage, profile_id, '0'))
|
||||||
hasMorePages = cursor < lastPage
|
hasMorePages = cursor < lastPage
|
||||||
resp['next'] = cursor + 1 if hasMorePages else None
|
resp['next'] = cursor + 1 if hasMorePages else None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user