mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-22 22:34:01 -07:00
Apply suggestions from code review
Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
parent
87393c7566
commit
2f0fee0f59
1 changed files with 4 additions and 6 deletions
|
@ -11,7 +11,7 @@ from ..utils import (
|
||||||
|
|
||||||
|
|
||||||
class FileMoonIE(InfoExtractor):
|
class FileMoonIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?filemoon\.sx/./(?P<id>\w+)(?:/(?P<title>.+))*'
|
_VALID_URL = r'https?://(?:www\.)?filemoon\.sx/./(?P<id>\w+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://filemoon.sx/e/dw40rxrzruqz',
|
'url': 'https://filemoon.sx/e/dw40rxrzruqz',
|
||||||
'md5': '5a713742f57ac4aef29b74733e8dda01',
|
'md5': '5a713742f57ac4aef29b74733e8dda01',
|
||||||
|
@ -23,12 +23,10 @@ class FileMoonIE(InfoExtractor):
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id, title = re.match(self._VALID_URL, url).group('id', 'title')
|
video_id = self._match_id(url)
|
||||||
if not title:
|
|
||||||
title = video_id
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
matches = re.findall(r'(?s)(eval.*?)<\/script>', webpage)
|
matches = re.findall(r'(?s)(eval.*?)</script>', webpage)
|
||||||
packed = matches[-1]
|
packed = matches[-1]
|
||||||
unpacked = decode_packed_codes(packed)
|
unpacked = decode_packed_codes(packed)
|
||||||
jwplayer_sources = self._parse_json(
|
jwplayer_sources = self._parse_json(
|
||||||
|
@ -40,6 +38,6 @@ class FileMoonIE(InfoExtractor):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': self._generic_title(url) or video_id,
|
||||||
'formats': formats
|
'formats': formats
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue