1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-29 19:47:54 +01:00

[thisav] Fix video extraction.

This commit is contained in:
Alex Vong 2019-02-04 10:00:03 +08:00
parent 07fbfef1c7
commit f0b6136f11
No known key found for this signature in database
GPG Key ID: 61EF502EF60252F2

View File

@ -4,7 +4,7 @@ from __future__ import unicode_literals
import re import re
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import remove_end from ..utils import urljoin, xpath_text
class ThisAVIE(InfoExtractor): class ThisAVIE(InfoExtractor):
@ -38,11 +38,16 @@ class ThisAVIE(InfoExtractor):
video_id = mobj.group('id') video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
title = remove_end(self._html_search_regex( title = self._html_search_regex(r'<title>(?:([^<]+)-\s*視頻\s*-\s*ThisAV.com\s*-\s*世界第一中文成人娛樂網站\s*|([^<]+))</title>', webpage, 'title')
r'<title>([^<]+)</title>', webpage, 'title'),
' - 視頻 - ThisAV.com-世界第一中文成人娛樂網站') mpd_url = self._html_search_regex(
video_url = self._html_search_regex( r'"(https?://[^"]+\.mpd)"', webpage, 'MPD URL')
r"addVariable\('file','([^']+)'\);", webpage, 'video url', default=None) mpd_root = self._download_xml(mpd_url, video_id)
mpd_ns = self._search_regex(
r'\{([^}]+)\}', mpd_root.tag, 'MPD namespace', default=None)
base_url = xpath_text(mpd_root, self._xpath_ns('.//BaseURL', mpd_ns))
video_url = urljoin(mpd_url, base_url)
if video_url: if video_url:
info_dict = { info_dict = {
'formats': [{ 'formats': [{