Merge pull request #19 from nixxo/patch-1

[mtv] Fix a missing match_id
This commit is contained in:
Tom-Oliver Heidel 2020-10-31 09:02:06 +01:00 committed by GitHub
commit 12ae240c36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -289,7 +289,7 @@ class MTVServicesInfoExtractor(InfoExtractor):
return mgid return mgid
def _extract_mgid(self, webpage, url, data_zone=None): def _extract_mgid(self, webpage, url, title=None, data_zone=None):
try: try:
# the url can be http://media.mtvnservices.com/fb/{mgid}.swf # the url can be http://media.mtvnservices.com/fb/{mgid}.swf
# or http://media.mtvnservices.com/{mgid} # or http://media.mtvnservices.com/{mgid}
@ -300,7 +300,8 @@ class MTVServicesInfoExtractor(InfoExtractor):
except RegexNotFoundError: except RegexNotFoundError:
mgid = None mgid = None
title = self._match_id(url) if not title:
title = url_basename(url)
try: try:
window_data = self._parse_json(self._search_regex( window_data = self._parse_json(self._search_regex(
@ -336,7 +337,7 @@ class MTVServicesInfoExtractor(InfoExtractor):
def _real_extract(self, url): def _real_extract(self, url):
title = url_basename(url) title = url_basename(url)
webpage = self._download_webpage(url, title) webpage = self._download_webpage(url, title)
mgid = self._extract_mgid(webpage, url) mgid = self._extract_mgid(webpage, url, title=title)
videos_info = self._get_videos_info(mgid, url=url) videos_info = self._get_videos_info(mgid, url=url)
return videos_info return videos_info