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

[Youtuner] Add new extractor #22412

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions youtube_dl/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,7 @@
YoutubeUserIE,
YoutubeWatchLaterIE,
)
from .youtuner import YoutunerIE
from .zapiks import ZapiksIE
from .zaq1 import Zaq1IE
from .zattoo import (
Expand Down
34 changes: 34 additions & 0 deletions youtube_dl/extractor/youtuner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse


class YoutunerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?youtuner\.co/s/(?P<id>[0-9]+)'
_TEST = {
'url': 'https://youtuner.co/s/149379',
'md5': '1f9672e4c264f374101ded6a41e2540a',
'info_dict': {
'id': '149379',
'ext': 'mp3',
'title': 'Anime Crazies episódio 100! - Como tudo começou?',
'uploader': 'Anime Crazies',
'thumbnail': r're:^https?://.*\.jpg$',
}
}

def _real_extract(self, url):
video_id = self._match_id(url)

webpage = self._download_webpage(url, video_id)
thumbnail = "{0.scheme}://{0.netloc}/{1}".format(compat_urlparse.urlsplit(url), self._search_regex(r"<hgroup[^>]*>[^<]+<div[^>]+style=\"[^']+'([^']+)'", webpage, 'thumbnail'))
title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title')
url = self._html_search_regex(r'<audio[^>]*>[^<]+<source[^>]+src=\"([^\"]+)\"', webpage, 'url')
return {
'id': video_id,
'title': title,
'uploader': self._search_regex(r'<p[^>]+class=\"entry-meta\"[^>]*>[^<]+<a[^<]+>([^<]+)<', webpage, 'uploader', fatal=False),
'url': url,
'thumbnail': thumbnail,
}