[RadioFrance] run autopep

This commit is contained in:
lonm 2024-10-15 16:35:28 +01:00
parent dcd0ee3ec3
commit dda6f7b563

View File

@ -281,9 +281,9 @@ def _extract_embedded_episodes(self, item, webpage, content_id):
links = item['playerInfo']['media']['sources']
item['formats'] = []
for linkkey in links:
url = self._search_regex(linkkey+r'\.url="([^"]+)";', 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)
url = self._search_regex(linkkey + r'\.url="([^"]+)";', 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)
item['formats'].append({
'format_id': preset['id'],
'url': url,
@ -457,7 +457,7 @@ def _call_api(self, station, profile_id, cursor):
# get the page data
pagekey = pagedata['pagination']
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
resp['next'] = cursor + 1 if hasMorePages else None