[UDNEmbed]modify regex in udn.py
This commit is contained in:
parent
b0ae68de85
commit
79f4be30a3
@ -706,7 +706,7 @@ from .udemy import (
|
|||||||
UdemyIE,
|
UdemyIE,
|
||||||
UdemyCourseIE
|
UdemyCourseIE
|
||||||
)
|
)
|
||||||
from .udn import UDNIE
|
from .udn import UDNEmbedIE
|
||||||
from .ultimedia import UltimediaIE
|
from .ultimedia import UltimediaIE
|
||||||
from .unistra import UnistraIE
|
from .unistra import UnistraIE
|
||||||
from .urort import UrortIE
|
from .urort import UrortIE
|
||||||
|
@ -42,7 +42,7 @@ from .sportbox import SportBoxEmbedIE
|
|||||||
from .smotri import SmotriIE
|
from .smotri import SmotriIE
|
||||||
from .myvi import MyviIE
|
from .myvi import MyviIE
|
||||||
from .condenast import CondeNastIE
|
from .condenast import CondeNastIE
|
||||||
from .udn import UDNIE
|
from .udn import UDNEmbedIE
|
||||||
from .senateisvp import SenateISVPIE
|
from .senateisvp import SenateISVPIE
|
||||||
from .bliptv import BlipTVIE
|
from .bliptv import BlipTVIE
|
||||||
from .svt import SVTIE
|
from .svt import SVTIE
|
||||||
|
@ -10,9 +10,9 @@ from ..utils import (
|
|||||||
from ..compat import compat_urlparse
|
from ..compat import compat_urlparse
|
||||||
|
|
||||||
|
|
||||||
class UDNIE(InfoExtractor):
|
class UDNEmbedIE(InfoExtractor):
|
||||||
IE_DESC = '聯合影音'
|
IE_DESC = '聯合影音'
|
||||||
_VALID_URL = r'https?://video\.udn\.com/((?:embed|play)/)?news/(?P<id>\d+)'
|
_VALID_URL = r'(?:https?:)?//video\.udn\.com/(?:embed|play)/news/(?P<id>\d+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://video.udn.com/embed/news/300040',
|
'url': 'http://video.udn.com/embed/news/300040',
|
||||||
'md5': 'de06b4c90b042c128395a88f0384817e',
|
'md5': 'de06b4c90b042c128395a88f0384817e',
|
||||||
@ -32,10 +32,6 @@ class UDNIE(InfoExtractor):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
if "embed" not in url and "play" not in url:
|
|
||||||
p = url.index("com/") + 4
|
|
||||||
url = url[:p] + "embed/" + url[p:]
|
|
||||||
|
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
page = self._download_webpage(url, video_id)
|
page = self._download_webpage(url, video_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user