mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-23 19:35:19 +01:00
[mofosex] Add support for generic embeds (closes #24633)
This commit is contained in:
parent
52c4c51556
commit
4e7b5bba5f
|
@ -636,7 +636,10 @@ from .mixcloud import (
|
||||||
from .mlb import MLBIE
|
from .mlb import MLBIE
|
||||||
from .mnet import MnetIE
|
from .mnet import MnetIE
|
||||||
from .moevideo import MoeVideoIE
|
from .moevideo import MoeVideoIE
|
||||||
from .mofosex import MofosexIE
|
from .mofosex import (
|
||||||
|
MofosexIE,
|
||||||
|
MofosexEmbedIE,
|
||||||
|
)
|
||||||
from .mojvideo import MojvideoIE
|
from .mojvideo import MojvideoIE
|
||||||
from .morningstar import MorningstarIE
|
from .morningstar import MorningstarIE
|
||||||
from .motherless import (
|
from .motherless import (
|
||||||
|
|
|
@ -60,6 +60,7 @@ from .tnaflix import TNAFlixNetworkEmbedIE
|
||||||
from .drtuber import DrTuberIE
|
from .drtuber import DrTuberIE
|
||||||
from .redtube import RedTubeIE
|
from .redtube import RedTubeIE
|
||||||
from .tube8 import Tube8IE
|
from .tube8 import Tube8IE
|
||||||
|
from .mofosex import MofosexEmbedIE
|
||||||
from .spankwire import SpankwireIE
|
from .spankwire import SpankwireIE
|
||||||
from .youporn import YouPornIE
|
from .youporn import YouPornIE
|
||||||
from .vimeo import VimeoIE
|
from .vimeo import VimeoIE
|
||||||
|
@ -2717,6 +2718,11 @@ class GenericIE(InfoExtractor):
|
||||||
if tube8_urls:
|
if tube8_urls:
|
||||||
return self.playlist_from_matches(tube8_urls, video_id, video_title, ie=Tube8IE.ie_key())
|
return self.playlist_from_matches(tube8_urls, video_id, video_title, ie=Tube8IE.ie_key())
|
||||||
|
|
||||||
|
# Look for embedded Mofosex player
|
||||||
|
mofosex_urls = MofosexEmbedIE._extract_urls(webpage)
|
||||||
|
if mofosex_urls:
|
||||||
|
return self.playlist_from_matches(mofosex_urls, video_id, video_title, ie=MofosexEmbedIE.ie_key())
|
||||||
|
|
||||||
# Look for embedded Spankwire player
|
# Look for embedded Spankwire player
|
||||||
spankwire_urls = SpankwireIE._extract_urls(webpage)
|
spankwire_urls = SpankwireIE._extract_urls(webpage)
|
||||||
if spankwire_urls:
|
if spankwire_urls:
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
int_or_none,
|
int_or_none,
|
||||||
str_to_int,
|
str_to_int,
|
||||||
|
@ -54,3 +57,23 @@ class MofosexIE(KeezMoviesIE):
|
||||||
})
|
})
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
||||||
|
class MofosexEmbedIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?mofosex\.com/embed/?\?.*?\bvideoid=(?P<id>\d+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'https://www.mofosex.com/embed/?videoid=318131&referrer=KM',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _extract_urls(webpage):
|
||||||
|
return re.findall(
|
||||||
|
r'<iframe[^>]+\bsrc=["\']((?:https?:)?//(?:www\.)?mofosex\.com/embed/?\?.*?\bvideoid=\d+)',
|
||||||
|
webpage)
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
return self.url_result(
|
||||||
|
'http://www.mofosex.com/videos/{0}/{0}.html'.format(video_id),
|
||||||
|
ie=MofosexIE.ie_key(), video_id=video_id)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user