[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\.-_]+)/'
@ -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,10 +91,8 @@ 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]
entries = []