Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add various anime download sites #4554

Closed
wants to merge 11 commits into from
Binary file added youtube-dl
Binary file not shown.
19 changes: 19 additions & 0 deletions youtube_dl/extractor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@
from .godtube import GodTubeIE
from .goldenmoustache import GoldenMoustacheIE
from .golem import GolemIE
from .gogoanime import (
GoGoAnimeIE,
GoGoAnimeSearchIE
)
from .googleplus import GooglePlusIE
from .googlesearch import GoogleSearchIE
from .gorillavid import GorillaVidIE
Expand Down Expand Up @@ -304,6 +308,16 @@
from .photobucket import PhotobucketIE
from .planetaplay import PlanetaPlayIE
from .played import PlayedIE
from .play44 import (
Play44IE,
ByZooIE,
Video44IE,
VideoWingIE,
PlayPandaIE,
VideoZooIE,
PlayBBIE,
EasyVideoIE
)
from .playfm import PlayFMIE
from .playvid import PlayvidIE
from .podomatic import PodomaticIE
Expand Down Expand Up @@ -364,6 +378,10 @@
from .snotr import SnotrIE
from .sockshare import SockshareIE
from .sohu import SohuIE
from .soulanime import (
SoulAnimeWatchingIE,
SoulAnimeSeriesIE
)
from .soundcloud import (
SoundcloudIE,
SoundcloudSetIE,
Expand Down Expand Up @@ -457,6 +475,7 @@
from .videobam import VideoBamIE
from .videodetective import VideoDetectiveIE
from .videolecturesnet import VideoLecturesNetIE
from .videofun import VideoFunIE
from .videofyme import VideofyMeIE
from .videomega import VideoMegaIE
from .videopremium import VideoPremiumIE
Expand Down
109 changes: 109 additions & 0 deletions youtube_dl/extractor/gogoanime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
from __future__ import unicode_literals

import re

from .common import InfoExtractor
from ..utils import (
ExtractorError,
compat_urlparse,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused.

compat_urllib_parse,
get_element_by_attribute,
unescapeHTML
)


class GoGoAnimeIE(InfoExtractor):
IE_NAME = 'gogoanime'
IE_DESC = 'GoGoAnime'

_VALID_URL = r'http://www.gogoanime.com/(?P<id>[A-Za-z0-9-]+)'

_NOT_FOUND_REGEX = r'Oops! Page Not Found</font>'
_FILEKEY_REGEX = r'flashvars\.filekey="(?P<filekey>[^"]+)";'
_TITLE_REGEX = r'<div class="postdesc">[^<]*<h1>([^<]+)</h1>'

_SINGLEPART_REGEX = r'<div class="postcontent">[^<]*<p><iframe src=[\'"][^>]+></iframe></p>'
_MULTIPART_REGEX = r'<div class="postcontent">[^<]*<p><iframe src=[\'"][^>]+></iframe><br />'
_POSTCONTENT_REGEX = r'<div class="postcontent">(?P<content>(?!</div>)*)</div>'
_IFRAME_REGEX = r'<iframe[^>]*src=[\'"](h[^\'"]+)[\'"]'

"""_TEST = {
'url': 'http://www.gogoanime.com/mahou-shoujo-madoka-magica-episode-12',
'md5': 'd9b511f92ce9348206f8481ba19dc9f1',
'info_dict': {
'id': 'Mahou-Shoujo-Madoka-Magica-12',
'ext': 'flv',
'title': 'Mahou-Shoujo-Madoka-Magica-12',
'description': 'Mahou-Shoujo-Madoka-Magica-12'
}
},"""
_TEST = {
'url': 'http://www.gogoanime.com/mahou-shoujo-madoka-magica-movie-1',
'info_dict': {
'id': 'mahou-shoujo-madoka-magica-movie-1'
},
'playlist_count': 3
}

def _real_extract(self, url):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not work for me:

> python -m youtube_dl -v http://www.gogoanime.com/mahou-shoujo-madoka-magica-movie-1
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.gogoanime.com/mahou-shoujo-madoka-magica-movie-1']
[debug] Encodings: locale cp1251, fs mbcs, out None, pref cp1251
[debug] youtube-dl version 2014.12.17.2
[debug] Python version 2.7.6 - Windows-2003Server-5.2.3790-SP2
[debug] exe versions: ffmpeg N-68694-g7c210c4, ffprobe N-68694-g7c210c4, rtmpdump 2.3
[debug] Proxy map: {}
[gogoanime] mahou-shoujo-madoka-magica-movie-1: Downloading video page
[download] Downloading playlist: mahou-shoujo-madoka-magica-movie-1
[gogoanime] playlist mahou-shoujo-madoka-magica-movie-1: Collected 3 video ids (downloading 3 of them)
[download] Downloading video 1 of 3
[generic] a8d6a39522df066bd734a69f2334497e?w=600&h=438: Requesting header
WARNING: Falling back on generic information extractor.
[generic] a8d6a39522df066bd734a69f2334497e?w=600&h=438: Downloading webpage
[generic] a8d6a39522df066bd734a69f2334497e?w=600&h=438: Extracting information
ERROR: Unsupported URL: http://videowing.me/embed/a8d6a39522df066bd734a69f2334497e?w=600&h=438; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "youtube_dl\extractor\generic.py", line 660, in _real_extract
    doc = parse_xml(webpage)
  File "youtube_dl\utils.py", line 1444, in parse_xml
    tree = xml.etree.ElementTree.XML(s.encode('utf-8'), **kwargs)
  File "C:\Python27\lib\xml\etree\ElementTree.py", line 1300, in XML
    parser.feed(text)
  File "C:\Python27\lib\xml\etree\ElementTree.py", line 1642, in feed
    self._raiseerror(v)
  File "C:\Python27\lib\xml\etree\ElementTree.py", line 1506, in _raiseerror
    raise err
ParseError: not well-formed (invalid token): line 23, column 1861
Traceback (most recent call last):
  File "youtube_dl\YoutubeDL.py", line 592, in extract_info
    ie_result = ie.extract(url)
  File "youtube_dl\extractor\common.py", line 243, in extract
    return self._real_extract(url)
  File "youtube_dl\extractor\generic.py", line 1060, in _real_extract
    raise ExtractorError('Unsupported URL: %s' % url)
ExtractorError: Unsupported URL: http://videowing.me/embed/a8d6a39522df066bd734a69f2334497e?w=600&h=438; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')

page = self._download_webpage(url, video_id, "Downloading video page")

if re.search(self._NOT_FOUND_REGEX, page) is not None:
raise ExtractorError('Video does not exist', expected=True)

title = self._html_search_regex(self._TITLE_REGEX, page, 'title', fatal=False)
description = title

content = get_element_by_attribute("class", "postcontent", page)

pattern = re.compile(self._IFRAME_REGEX)
vids = pattern.findall(content)

vids = [unescapeHTML(compat_urllib_parse.unquote(x)) for x in vids if not re.search(".*videofun.*", x)]

if (re.search(self._SINGLEPART_REGEX, page)):
return {
'_type': 'url',
'id': None,
'url': vids[0],
'title': title,
'description': title
}

if (re.search(self._MULTIPART_REGEX, page)):
return self.playlist_result([self.url_result(vid) for vid in vids], video_id)

print("Error parsing!")
return {}


class GoGoAnimeSearchIE(InfoExtractor):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

IE_NAME = 'gogoanime:search'
IE_DESC = 'GoGoAnime Search'

_VALID_URL = r'http://www\.gogoanime\.com/.*\?s=(?P<id>.*)'

_POSTLIST_REGEX = r'<div class="postlist">[^<]*<p[^>]*>[^<]*<a href="(?P<url>[^"]+)"'

_TEST = {
'url': 'http://www.gogoanime.com/?s=bokusatsu',
'info_dict': {
'id': 'bokusatsu'
},
'playlist_count': 6
}

def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')

page = self._download_webpage(url, video_id, "Downloading video page")

pattern = re.compile(self._POSTLIST_REGEX)
content = pattern.findall(page)

return self.playlist_result([self.url_result(vid) for vid in content], video_id)

167 changes: 167 additions & 0 deletions youtube_dl/extractor/play44.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
from __future__ import unicode_literals

import re

from .common import InfoExtractor
from ..utils import (
ExtractorError,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused.

compat_urllib_parse
)


class Play44IE(InfoExtractor):
IE_NAME = 'play44'
IE_DESC = 'Play44'

_VALID_URL = r'http://[w.]*play44\.net/embed\.php[^/]*/(?P<id>.+)'

_VIDEO_URL_REGEX = r'_url = "(https?://[^"]+)";'
_TITLE_REGEX = r'.*/(?P<title>[^.]*).'

_TEST = {
'url': 'http://play44.net/embed.php?w=600&h=438&vid=M/mahou-shoujo-madoka-magica-07.flv',
'md5': 'e37e99d665f503dd2db952f7c4dba9e6',
'info_dict': {
'id': 'mahou-shoujo-madoka-magica-07',
'ext': 'flv',
'title': 'mahou-shoujo-madoka-magica-07',
'description': 'mahou-shoujo-madoka-magica-07'
}
}

def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')

page = self._download_webpage(url, video_id, "Downloading video page")

video_url_encoded = self._html_search_regex(self._VIDEO_URL_REGEX, page, 'url', fatal=True)
video_url = compat_urllib_parse.unquote(video_url_encoded)

title = re.match(self._TITLE_REGEX, video_url).group('title')

return {
'id': title,
'url': video_url,
'title': title,
'description': title
}

class ByZooIE(Play44IE):
IE_NAME = "byzoo"
IE_DESC = "ByZoo"

_VALID_URL = r'http://[w.]*byzoo\.org/embed\.php[^/]*/(?P<id>.+)'

_TEST = {
'url': 'http://byzoo.org/embed.php?w=600&h=438&vid=at/nw/mahou_shoujo_madoka_magica_movie_3_-_part1.mp4',
'md5': '455c83dabe2cd9fd74a87612b01fe017',
'info_dict': {
'id': 'mahou_shoujo_madoka_magica_movie_3_-_part1',
'ext': 'mp4',
'title': 'mahou_shoujo_madoka_magica_movie_3_-_part1',
'description': 'mahou_shoujo_madoka_magica_movie_3_-_part1'
}
}

class Video44IE(Play44IE):
IE_NAME = "video44"
IE_DESC = "Video44"

_VALID_URL = r'http://[w.]*video44\.net/.*file=(?P<id>[^&].).*'

_TEST = {
'url': 'http://www.video44.net/gogo/?w=600&h=438&file=chaoshead-12.flv&sv=1',
'md5': '43eaec6d0beb10e8d42459b9f108aff3',
'info_dict': {
'id': 'chaoshead-12',
'ext': 'mp4',
'title': 'chaoshead-12',
'description': 'chaoshead-12'
}
}

class VideoWingIE(Play44IE):
IE_NAME = "videowing"
IE_DESC = "VideoWing"

_VALID_URL = r'http://[w.]*videowing\.[^/]*/.*video=/*(?P<id>[^&].).*'

_TEST = {
'url': 'http://videowing.me/embed?w=718&h=438&video=ongoing/boku_wa_tomodachi_ga_sukunai_-_05.mp4',
'md5': '4ed320e353ed26c742c4f12a9c210b60',
'info_dict': {
'id': 'boku_wa_tomodachi_ga_sukunai_-_05',
'ext': 'mp4',
'title': 'boku_wa_tomodachi_ga_sukunai_-_05',
'description': 'boku_wa_tomodachi_ga_sukunai_-_05'
}
}

class PlayPandaIE(Play44IE):
IE_NAME = "playpanda"
IE_DESC = "PlayPanda"

_VALID_URL = r'http://[w.]*playpanda\.[^/]*/.*vid=/*(?P<id>[^&].).*'

_TEST = {
'url': 'http://playpanda.net/embed.php?w=718&h=438&vid=at/nw/boku_wa_tomodachi_ga_sukunai_-_05.mp4',
'md5': '4ed320e353ed26c742c4f12a9c210b60',
'info_dict': {
'id': 'boku_wa_tomodachi_ga_sukunai_-_05',
'ext': 'mp4',
'title': 'boku_wa_tomodachi_ga_sukunai_-_05',
'description': 'boku_wa_tomodachi_ga_sukunai_-_05'
}
}

class VideoZooIE(Play44IE):
IE_NAME = "videozoo"
IE_DESC = "videozoo"

_VALID_URL = r'http://[w.]*videozoo\.[^/]*/.*vid=/*(?P<id>[^&].).*'

_TEST = {
'url': 'http://videozoo.me/embed.php?w=718&h=438&vid=at/nw/boku_wa_tomodachi_ga_sukunai_-_05.mp4',
'md5': '4ed320e353ed26c742c4f12a9c210b60',
'info_dict': {
'id': 'boku_wa_tomodachi_ga_sukunai_-_05',
'ext': 'mp4',
'title': 'boku_wa_tomodachi_ga_sukunai_-_05',
'description': 'boku_wa_tomodachi_ga_sukunai_-_05'
}
}

class PlayBBIE(Play44IE):
IE_NAME = "playbb"
IE_DESC = "PlayBB"

_VALID_URL = r'http://[w.]*playbb\.[^/]*/.*vid=/*(?P<id>[^&].).*'

_TEST = {
'url': 'http://playbb.me/embed.php?w=718&h=438&vid=at/nw/boku_wa_tomodachi_ga_sukunai_-_05.mp4',
'md5': '4ed320e353ed26c742c4f12a9c210b60',
'info_dict': {
'id': 'boku_wa_tomodachi_ga_sukunai_-_05',
'ext': 'mp4',
'title': 'boku_wa_tomodachi_ga_sukunai_-_05',
'description': 'boku_wa_tomodachi_ga_sukunai_-_05'
}
}

class EasyVideoIE(Play44IE):
IE_NAME = "easyvideo"
IE_DESC = "EasyVideo"

_VALID_URL = r'http://[w.]*easyvideo\.[^/]*/.*file=/*(?P<id>[^&].).*'

_TEST = {
'url': 'http://easyvideo.me/gogo/?w=718&h=438&file=bokuwatomodachigasukunai-04.flv&sv=1',
'md5': '26178b57629b7650106d72b191137176',
'info_dict': {
'id': 'bokuwatomodachigasukunai-04',
'ext': 'mp4',
'title': 'bokuwatomodachigasukunai-04',
'description': 'bokuwatomodachigasukunai-04'
}
}
Loading