Skip to content

Commit

Permalink
Merge pull request #130 from blackjack4494/master
Browse files Browse the repository at this point in the history
Release 2020.11.07
  • Loading branch information
blackjack4494 committed Nov 7, 2020
2 parents 5943bb6 + 651bae3 commit dca6e6b
Show file tree
Hide file tree
Showing 14 changed files with 351 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.8'
- name: Install packages
run: sudo apt-get -y install zip pandoc man
- name: Bump version
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[![Build Status](https://travis-ci.com/blackjack4494/yt-dlc.svg?branch=master)](https://travis-ci.com/blackjack4494/yt-dlc)
[![PyPi](https://img.shields.io/pypi/v/youtube-dlc.svg)](https://pypi.org/project/youtube-dlc)
[![Downloads](https://pepy.tech/badge/youtube-dlc)](https://pepy.tech/project/youtube-dlc)

[![Gitter chat](https://img.shields.io/gitter/room/youtube-dlc/community)](https://gitter.im/youtube-dlc)
[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](https://github.com/blackjack4494/youtube-dlc/blob/master/LICENSE)
[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](https://github.com/blackjack4494/yt-dlc/blob/master/LICENSE)

youtube-dlc - download videos from youtube.com or other video platforms.

youtube-dlc is a fork of youtube-dl with the intention of getting features tested by the community merged in the tool faster, since youtube-dl's development seems to be slowing down. (https://web.archive.org/web/20201014194602/https://github.com/ytdl-org/youtube-dl/issues/26462)

- [INSTALLATION](#installation)
- [UPDATE](#update)
- [DESCRIPTION](#description)
- [OPTIONS](#options)
- [Network Options:](#network-options)
Expand Down Expand Up @@ -44,6 +44,10 @@ You may want to use `python3` instead of `python`

python -m pip install --upgrade youtube-dlc

If you want to install the current master branch

python -m pip install git+https://github.com/blackjack4494/yt-dlc

**UNIX** (Linux, macOS, etc.)
Using wget:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def run(self):
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
# long_description_content_type="text/markdown",
url="https://github.com/blackjack4494/youtube-dlc",
url="https://github.com/blackjack4494/yt-dlc",
packages=find_packages(exclude=("youtube_dl","test",)),
#packages=[
# 'youtube_dlc',
Expand Down
11 changes: 6 additions & 5 deletions youtube_dlc/downloader/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,12 @@ def download(self, filename, info_dict, subtitle=False):
else '%.2f' % sleep_interval))
time.sleep(sleep_interval)
else:
sleep_interval_sub = self.params.get('sleep_interval_subtitles')
self.to_screen(
'[download] Sleeping %s seconds...' % (
int(sleep_interval_sub)))
time.sleep(sleep_interval_sub)
if self.params.get('sleep_interval_subtitles') > 0:
sleep_interval_sub = self.params.get('sleep_interval_subtitles')
self.to_screen(
'[download] Sleeping %s seconds...' % (
sleep_interval_sub))
time.sleep(sleep_interval_sub)
return self.real_download(filename, info_dict)

def real_download(self, filename, info_dict):
Expand Down
1 change: 1 addition & 0 deletions youtube_dlc/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1544,4 +1544,5 @@
)
from .zdf import ZDFIE, ZDFChannelIE
from .zingmp3 import ZingMp3IE
from .zoom import ZoomIE
from .zype import ZypeIE
3 changes: 3 additions & 0 deletions youtube_dlc/extractor/la7.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class LA7IE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)

if not url.startswith('http'):
url = '%s//%s' % (self.http_scheme(), url)

webpage = self._download_webpage(url, video_id)

player_data = self._search_regex(
Expand Down
13 changes: 11 additions & 2 deletions youtube_dlc/extractor/mailru.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
parse_duration,
remove_end,
try_get,
urljoin,
)


Expand Down Expand Up @@ -93,6 +94,14 @@ class MailRuIE(InfoExtractor):
{
'url': 'https://my.mail.ru//list//sinyutin10/video/_myvideo/4.html',
'only_matching': True,
},
{
'url': 'https://my.mail.ru/mail/cloud-strife/video/embed/Games/2009',
'only_matching': True,
},
{
'url': 'https://videoapi.my.mail.ru/videos/embed/mail/cloud-strife/Games/2009.html',
'only_matching': True,
}
]

Expand All @@ -110,7 +119,7 @@ def _real_extract(self, url):
webpage = self._download_webpage(url, video_id)
page_config = self._parse_json(self._search_regex([
r'(?s)<script[^>]+class="sp-video__page-config"[^>]*>(.+?)</script>',
r'(?s)"video":\s*(\{.+?\}),'],
r'(?s)"video":\s*({.+?}),'],
webpage, 'page config', default='{}'), video_id, fatal=False)
if page_config:
meta_url = page_config.get('metaUrl') or page_config.get('video', {}).get('metaUrl') or page_config.get('metadataUrl')
Expand All @@ -121,7 +130,7 @@ def _real_extract(self, url):

# fix meta_url if missing the host address
if re.match(r'^\/\+\/', meta_url):
meta_url = 'https://my.mail.ru' + meta_url
meta_url = urljoin('https://my.mail.ru', meta_url)

if meta_url:
video_data = self._download_json(
Expand Down
4 changes: 4 additions & 0 deletions youtube_dlc/extractor/skyitalia.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SkyItaliaBaseIE(InfoExtractor):
'high': [854, 480],
'hd': [1280, 720]
}
_GEO_BYPASS = False

def _extract_video_id(self, url):
webpage = self._download_webpage(url, 'skyitalia')
Expand Down Expand Up @@ -43,6 +44,9 @@ def _get_formats(self, video_id, token):
'height': r[1]
})

if not formats and video_data.get('geob') == 1:
self.raise_geo_restricted(countries=['IT'])

self._sort_formats(formats)
title = video_data.get('title')
thumb = video_data.get('thumb')
Expand Down
20 changes: 9 additions & 11 deletions youtube_dlc/extractor/viki.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,19 +308,17 @@ def _real_extract(self, url):
'url': thumbnail.get('url'),
})

stream_ids = []
for f in formats:
s_id = f.get('stream_id')
if s_id is not None:
stream_ids.append(s_id)
new_video = self._download_json(
'https://www.viki.com/api/videos/%s' % video_id, video_id,
'Downloading new video JSON to get subtitles', headers={'x-viki-app-ver': '2.2.5.1428709186'}, expected_status=[200, 400, 404])

subtitles = {}
for subtitle_lang, _ in video.get('subtitle_completions', {}).items():
subtitles[subtitle_lang] = [{
'ext': subtitles_format,
'url': self._prepare_call(
'videos/%s/subtitles/%s.%s?stream_id=%s' % (video_id, subtitle_lang, subtitles_format, stream_ids[0])),
} for subtitles_format in ('srt', 'vtt')]
for sub in new_video.get('streamSubtitles').get('dash'):
subtitles[sub.get('srclang')] = [{
'ext': 'vtt',
'url': sub.get('src'),
'completion': sub.get('percentage'),
}]

result = {
'id': video_id,
Expand Down
Loading

0 comments on commit dca6e6b

Please sign in to comment.