Browse Source

Fix channel URLs

master
JustAnotherArchivist 3 years ago
parent
commit
bf695d63a3
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      youtube-extract

+ 1
- 1
youtube-extract View File

@@ -91,7 +91,7 @@ matchers = [
# (pattern, paramSearch, function(match: list[str]) -> output str or None); returning None stops further processing of a line
# If paramSearch is True, a corresponding pattern with [/:?=&] replaced by their percent encodings is generated; the reverse replacement is done again automatically before calling the function.
[noisePattern, False, lambda m: None],
[channelPattern, True, lambda m: 'https://www.youtube.com/' + m[0].split('/', 3)[-1].rstrip('/')],
[channelPattern, True, lambda m: 'https://www.youtube.com/' + m[0].split('/', 2)[-1].rstrip('/')],
[videoPattern, True, lambda m: f'https://www.youtube.com/watch?v={m[0][-11:]}'],
[r'/www\.youtube\.com/(?:playlist|embed(?:/videoseries|/\+lastest|/playlist)?/?)\?(?:.*&)?list=UU([0-9A-Za-z_-]+)', True, lambda m: f'https://www.youtube.com/channel/UC{m[1]}'],
[r'/www\.youtube\.com/(?:playlist|embed(?:/videoseries|/\+lastest|/playlist)?/?)\?(?:.*&)?list=((PL|FL|RD|OL)[0-9A-Za-z_-]+)', True, lambda m: f'https://www.youtube.com/playlist?list={m[1]}'],


Loading…
Cancel
Save