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

[yjc] Add new extractor #24661

Closed
wants to merge 1 commit 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 @@ -1449,6 +1449,7 @@
from .yapfiles import YapFilesIE
from .yesjapan import YesJapanIE
from .yinyuetai import YinYueTaiIE
from .yjc import yjcIE
from .ynet import YnetIE
from .youjizz import YouJizzIE
from .youku import (
Expand Down
32 changes: 32 additions & 0 deletions youtube_dl/extractor/yjc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from __future__ import unicode_literals

from .common import InfoExtractor


class yjcIE(InfoExtractor):
_VALID_URL = r'(?:https?://)?(?:www\.)?yjc\.ir/fa/news/(?P<id>\w+)/*'

_TESTS = {
# TODO: Implement
}

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

webpage = self._download_webpage(
url, video_id
)

title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')

download_url = self._html_search_regex(

r'((https:\/\/)cdn\.yjc\.ir/files/fa/news/[0-9]*/[0-9]*/[0-9]*/[0-9_]*\.mp4)',

webpage, "download_url"
)
return {
'id': video_id,
'url': download_url,
'title': title
}