Browse Source

youtube: use list comprehensions

tags/v0.9
Přemysl Janouch 4 years ago
parent
commit
d2611d3f82
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      plugins/youtube

+ 4
- 4
plugins/youtube View File

@@ -35,14 +35,14 @@ class Plugin:
print ('ZYKLONB print :%s' % what)

class YouTube (Plugin):
re_videos = list (map (lambda x: re.compile (x), [
re_videos = [re.compile (x) for x in [
r'youtube\.[a-z]+/[^ ]*[&?]v=([-\w]+)',
r'youtube\.[a-z]+/v/([-\w]+)',
r'youtu\.be/([-\w]+)'
]))
re_playlists = list (map (lambda x: re.compile (x), [
]]
re_playlists = [re.compile (x) for x in [
r'youtube\.[a-z]+/playlist[&?][^ ]*(?<=&|\?)list=([-\w]+)',
]))
]]

def print_info (self, channel, url, cb):
try:

Loading…
Cancel
Save