[extractors/fosdem] flake8 cleanup

This commit is contained in:
Jesse Millwood 2023-05-07 07:59:15 -04:00
parent 9a3f1a2a4d
commit 7187056b69

View file

@ -1,6 +1,6 @@
from .common import InfoExtractor
import re
import pdb
class FosdemIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:archive\.)?fosdem\.org/(?P<year>[0-9]{4})/schedule/(?P<url_type>track|event)/(?P<id>[\w\.-_]+)/'
@ -32,8 +32,8 @@ class FosdemIE(InfoExtractor):
}
},
{
'url':'https://fosdem.org/2023/schedule/event/hwacceluk/',
'info_dict':{
'url': 'https://fosdem.org/2023/schedule/event/hwacceluk/',
'info_dict': {
'id': 'hwacceluk',
'ext': 'webm',
'title': 'Hardware acceleration for Unikernels',
@ -47,7 +47,7 @@ class FosdemIE(InfoExtractor):
{
'url': 'https://fosdem.org/2023/schedule/track/microkernel_and_component_based_os/',
'playlist_count': 11,
'info_dict':{
'info_dict': {
'id': 'microkernel_and_component_based_os',
'title': 'Microkernel and Component-based OS devroom',
}
@ -76,10 +76,8 @@ class FosdemIE(InfoExtractor):
webpage,
'video url')
cast_rgx = r'<td><a href=\"/[0-9]+/schedule/speaker/[a-z_]+/\">(?P<speaker>\w+ \w+)</a></td>'
try:
cast = re.findall(cast_rgx, webpage, flags=re.UNICODE)
except:
cast = []
cast = re.findall(cast_rgx, webpage, flags=re.UNICODE) or []
return {
'id': video_id,
'title': title,
@ -93,12 +91,10 @@ class FosdemIE(InfoExtractor):
}
elif groups.get('url_type') == 'track':
events_rgx = r'<td><a href=\"(?P<event>/[0-9]+/schedule/event/[a-z0-9]+/)'
try:
events_slugs = re.findall(events_rgx, webpage)
except:
events_slugs = []
events_slugs = re.findall(events_rgx, webpage) or []
if len(events_slugs) > 0:
events_urls = ['https://fosdem.org'+slug for slug in events_slugs]
events_urls = ['https://fosdem.org' + slug for slug in events_slugs]
entries = []
for event_url in events_urls:
entries.append(self.url_result(event_url, 'Fosdem'))