0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-30 03:33:02 +00:00

Use match_id method instead of splitted URL

This commit is contained in:
robin 2015-02-05 21:49:13 +01:00
parent bc63d56cca
commit 67ce4f8820

View file

@ -21,7 +21,7 @@ class TweakersIE(InfoExtractor):
def _real_extract(self, url): def _real_extract(self, url):
splitted_url = re.split('.html|/', url) splitted_url = re.split('.html|/', url)
del splitted_url[-1] # To remove extra '/' at the end del splitted_url[-1] # To remove extra '/' at the end
video_id = splitted_url[4] video_id = self._match_id(url)
title = splitted_url[5].title() # Retrieve title for URL and capitalize title = splitted_url[5].title() # Retrieve title for URL and capitalize
splitted_url[3] = splitted_url[3] + '/player' # Add /player to get the player page splitted_url[3] = splitted_url[3] + '/player' # Add /player to get the player page
player_url = '/'.join(splitted_url) + '.html' player_url = '/'.join(splitted_url) + '.html'