Commit Graph

164 Commits

Author SHA1 Message Date
Luc Ritchie 4f3fa23e5a
[utils] Fix parsing `YYYYMMDD` dates in Nov/Dec (#2094)
The date format `%Y%m%d%H%M` will successfully match against
one-digit month, day, hour, and minute strings, even though %m et al.
are documented as being zero-padded. So dates without time in
Nov/Dec may be wrongly parsed as dates in January with time.

This commit adds a format string of `%Y%m%d` to our supported date
format strings directly below (higher priority) its problematic relatives.

Closes #2076
Authored by: wlritchi
2021-12-24 02:04:01 +05:30
pukkandan b69fd25c25
[cleanup] Misc cleanup
Closes #1942 #1976 #2020 #2058 #1984
2021-12-23 07:12:46 +05:30
pukkandan e0fd95737d
[outtmpl] Add alternate forms `F`, `D`
and improve `id` detection

F = sanitize as filename (# = restricted)
D = add Decimal suffixes

Closes #2085, 2081
2021-12-23 06:49:16 +05:30
The Hatsune Daishi adbc4ec4bb
[dash,youtube] Download live from start to end (#888)
* Add option `--live-from-start` to enable downloading live videos from start
* Add key `is_from_start` in formats to identify formats (of live videos) that downloads from start
* [dash] Create protocol `http_dash_segments_generator` that allows a function to be passed instead of fragments
* [fragment] Allow multiple live dash formats to download simultaneously
* [youtube] Implement fragment re-fetching for the live dash formats
* [youtube] Re-extract dash manifest every 5 hours (manifest expires in 6hrs)
* [postprocessor/ffmpeg] Add `FFmpegFixupDuplicateMoovPP` to fixup duplicated moov atoms

Known issue: Ctrl+C doesn't work on Windows when downloading multiple formats

Closes #1521
Authored by: nao20010128nao, pukkandan
2021-12-20 11:36:46 +05:30
Felix S d76d15a669
[utils] Update `std_headers` (#2023)
* Update our chrome versions used for `User-Agent`s
* Drop the `Accept-Charset` header that no browser emits any more

Authored by: kikuyan, fstirlitz
2021-12-18 05:34:24 +05:30
The Hatsune Daishi 2814f12ba4
[skeb] Add extractor (#1916)
Fixes: https://github.com/ytdl-org/youtube-dl/issues/30287
Authored by: nao20010128nao
2021-12-09 17:10:52 +05:30
pukkandan e3c7d49571
[compat] Suppress errors in enabling VT mode
Closes #1932
2021-12-08 19:58:50 +05:30
pukkandan 38d79fd16c
Use `parse_duration` for `--wait-for-video`
and some minor fix
2021-12-06 23:30:33 +05:30
pukkandan 43b2290658
Fix `--throttled-rate` 2021-12-03 02:52:53 +05:30
pukkandan ee8dd27a73
[cleanup] Add deprecation warnings 2021-11-29 23:34:33 +05:30
pukkandan f304da8a29
[cleanup] Misc cleanup
Closes #1805, closes #1800
2021-11-29 23:34:33 +05:30
pukkandan f2ebc5c7be
Option `--wait-for-video` to wait for scheduled streams 2021-11-29 22:52:01 +05:30
pukkandan 282f570918
[utils] Fix error when copying `LazyList` 2021-11-20 08:33:55 +05:30
pukkandan c07a39ae8e
[utils] Fix `PagedList`
Bug in d8cf8d97a8
2021-11-20 08:33:53 +05:30
pukkandan c5e3f84972
[utils] Allow alignment in `render_table`
and add tests
2021-11-20 08:33:51 +05:30
pukkandan d8cf8d97a8
[utils] Fix `PagedList` 2021-11-16 21:16:05 +05:30
pukkandan c586f9e8de
[cleanup] minor fixes 2021-11-10 04:19:54 +05:30
pukkandan aa9369a2d8
[cleanup] Minor improvements to error and debug messages 2021-11-10 04:19:33 +05:30
pukkandan 582fad70f5
[outtmpl] Do not traverse `None`
Closes #1585
2021-11-08 00:26:08 +05:30
pukkandan 34921b4345
[utils] Add `join_nonempty` 2021-11-06 07:53:55 +05:30
Francesco Frassinelli 73673ccff3
[RaiplayRadio] Add extractors (#780)
Original PR: https://github.com/ytdl-org/youtube-dl/pull/21837
Authored by: frafra
2021-11-05 22:24:56 +05:30
pukkandan 9af98e17bd
[ffmpeg] Framework for feature detection
Related: #1502, #1237, https://github.com/ytdl-org/youtube-dl/pull/29581
2021-11-04 02:16:39 +05:30
pukkandan 31c49255bf
[ExtractAudio] Rescale --audio-quality correctly
Authored by: CrypticSignal, pukkandan
2021-11-04 00:05:53 +05:30
pukkandan 9bd979ca40
[utils] Parse `vp09` as vp9 2021-11-03 16:35:08 +05:30
pukkandan 16b0d7e621
[utils] Add `jwt_decode_hs256`
Code from #1340
Authored by: Ashish0804
2021-10-28 02:07:41 +05:30
pukkandan 0db3bae879
[extractor] Fix some errors being converted to `ExtractorError` 2021-10-26 20:27:09 +05:30
pukkandan 48f796874d
[utils] Create `DownloadCancelled` exception
as super-class of ExistingVideoReached, RejectedVideoReached, MaxDownloadsReached

Third parties can also sub-class this to cancel the download queue from a hook
2021-10-26 20:27:09 +05:30
pukkandan 08438d2ca5
[outtmpl] Add type `link` for internet shortcut files
and refactor related code
Closes #1405
2021-10-26 20:27:09 +05:30
pukkandan 7de837a5e3
[utils] Sanitize URL when determining protocol
Closes #1406
2021-10-26 20:26:08 +05:30
pukkandan 9f1a1c36e6
Separate `--check-all-formats` from `--check-formats`
Previously, `--check-formats` tested only the selected video formats, but ALL thumbnails
2021-10-24 15:00:17 +05:30
pukkandan ec11a9f4a2
[minicurses] Add more colors 2021-10-23 05:23:38 +05:30
Damiano Amatruda 17ec8bcfa9
[microsoftstream] Add extractor (#1201)
Based on: https://github.com/ytdl-org/youtube-dl/pull/24649
Fixes: https://github.com/ytdl-org/youtube-dl/issues/24440
Authored by: damianoamatruda, nixklai
2021-10-22 05:34:00 +05:30
pukkandan d3c93ec2b7
Don't create console for subprocesses on Windows (#1261)
Closes #1251
2021-10-20 21:49:40 +05:30
pukkandan aa7785f860
[utils] Standardize timestamp formatting code
Closes #1285
2021-10-19 22:58:25 +05:30
pukkandan 176f1866cb
Add HDR information to formats 2021-10-18 18:35:02 +05:30
Ákos Sülyi 019a94f7d6
[utils] Use `importlib` to load plugins (#1277)
Authored by: sulyi
2021-10-18 07:16:49 +05:30
pukkandan 18f96d129b
[utils] Allow duration strings in filter
Closes #1309
2021-10-17 17:39:33 +05:30
pukkandan 6993f78d1b
[extractor,utils] Detect more codecs/mimetypes
Fixes: https://github.com/ytdl-org/youtube-dl/issues/29943
2021-10-13 05:05:29 +05:30
pukkandan d1d5c08f29
[minicurses] Fix when printing to file
Closes #1215
2021-10-10 09:31:59 +05:30
pukkandan 2614f64600
[utils] Let traverse_obj accept functions as keys 2021-10-09 20:49:07 +05:30
pukkandan 819e05319b
Improved progress reporting (See desc) (#1125)
* Separate `--console-title` and `--no-progress`
* Add option `--progress` to show progress-bar even in quiet mode
* Fix and refactor `minicurses`
* Use `minicurses` for all progress reporting
* Standardize use of terminal sequences and enable color support for windows 10
* Add option `--progress-template` to customize progress-bar and console-title
* Add postprocessor hooks and progress reporting

Closes: #906, #901, #1085, #1170
2021-10-09 00:41:59 +05:30
pukkandan 4e3d1898a8
Workaround ssl errors in mingw python
Closes #1151
2021-10-06 05:45:16 +05:30
pukkandan 5d535b4a55
[build] Allow building with py2exe (and misc fixes)
py2exe config is copied from youtube-dl
Closes #1160
2021-10-04 03:08:27 +05:30
Felix S 9359f3d4f0
[extractor] Extract storyboards from SMIL manifests (#1128)
Authored by: fstirlitz
2021-10-03 00:13:42 +05:30
pukkandan 3ae5e79774
[postprocessor] Add plugin support
Adds option `--use-postprocessor` to enable them
2021-09-30 03:32:46 +05:30
pukkandan 7756277882
Workaround for bug in `ssl.SSLContext.load_default_certs` (#1118)
* Remove old compat code
* Load certificates only when not using nocheckcertificate
* Load each certificate individually

Closes #1060
Related bugs.python.org/issue35665, bugs.python.org/issue4531
2021-09-29 03:07:23 +05:30
pukkandan 91dd88b90f
[outtmpl] Alternate form of format type `l` for `\n` delimited list 2021-09-27 11:29:16 +05:30
pukkandan 524e2e4fda
[outtmpl] Format type `U` for unicode normalization 2021-09-26 01:41:01 +05:30
NeroBurner 49fa4d9af7
[atv.at] Use jwt for API (#1012)
The jwt token is implemented according to RFC7519

Closes #988
Authored by: NeroBurner
2021-09-23 23:10:51 +05:30
The Hatsune Daishi bd50a52b0d
Basic framework for simultaneous download of multiple formats (#1036)
Authored by: nao20010128nao
2021-09-22 19:42:04 +05:30
Yuan Chao a63d9bd0b0
[CGTN] Add extractor (#981)
Authored by: chao813
2021-09-19 17:48:22 +05:30
pukkandan f137e4c27c
[utils] Improve `extract_timezone`
Code taken from: https://github.com/ytdl-org/youtube-dl/pull/29845
Fixes: https://github.com/ytdl-org/youtube-dl/issues/29948
Authored by: dirkf
2021-09-19 17:45:49 +05:30
coletdjnz bccdbd22d5
[Mediaklikk] Add Extractor (#867)
Original PR: https://github.com/ytdl-org/youtube-dl/pull/17453, https://github.com/ytdl-org/youtube-dl/pull/25098
Fixes: https://github.com/ytdl-org/youtube-dl/issues/21431
Authored-by: tmarki, mrx23dot, coletdjnz
2021-09-06 12:22:38 +05:30
pukkandan 526d74ec5a
[cleanup] Misc 2021-09-05 11:16:23 +05:30
ChillingPepper 421ddcb8b4
[SovietsCloset] Add extractor (#884)
Authored by: ChillingPepper
2021-09-04 17:59:35 +05:30
pukkandan 8e5fecc88c
Handle more playlist errors with `-i` 2021-09-04 03:07:27 +05:30
The Hatsune Daishi 1931a55ee8
[radiko] Add extractors (#731)
https://github.com/ytdl-org/youtube-dl/issues/29840
Authored by: nao20010128nao
2021-08-25 10:18:27 +05:30
pukkandan 6251555f1c
[downloader/ffmpeg] Support for DASH manifests (experimental)
Closes #159
2021-08-24 05:52:00 +05:30
pukkandan 330690a214
[downloader/ffmpeg] Allow passing custom arguments before -i
Closes #686
2021-08-24 04:24:12 +05:30
pukkandan 1151c4079a
[extractor] Show video id in error messages if possible 2021-08-23 02:49:07 +05:30
pukkandan 4dfbf8696b
[utils] Add `parse_qs` 2021-08-23 00:50:43 +05:30
pukkandan 8f18aca871
Let `--match-filter` reject entries early
Makes redundant: `--match-title`, `--reject-title`, `--min-views`, `--max-views`
2021-08-17 04:29:56 +05:30
pukkandan 7be9ccff0b [utils] Fix `InAdvancePagedList.__getitem__`
Since it didn't have any cache, the page was re-fetched for each video.
* Also generalized the cache code
2021-08-10 04:45:25 +05:30
pukkandan b868936cd6 [cleanup] Misc 2021-08-07 21:17:07 +05:30
pukkandan 6e84b21559
Fix bugs related to `sanitize_info`
Related: 8012d892bd (r54555230)
2021-08-07 21:16:55 +05:30
pukkandan 575e17a1b9
[utils] Fix `traverse_obj` depth when is_user_input 2021-08-07 20:08:22 +05:30
pukkandan a047eeb6d2
Add regex to `--match-filter`
This does not fully deprecate `--match-title`/`--reject-title`
since `--match-filter` is only checked after the extraction is complete,
while `--match-title` can often be checked from the flat playlist.

Fixes: https://github.com/ytdl-org/youtube-dl/issues/9092, https://github.com/ytdl-org/youtube-dl/issues/23035
2021-08-05 04:10:26 +05:30
Max Teegen 77b87f0519 Add all format filtering operators also to `--match-filter`
PR: https://github.com/ytdl-org/youtube-dl/pull/27361

Authored by: max-te
2021-08-05 03:37:20 +05:30
pukkandan dbf5416a20 [cleanup] Refactor some code 2021-08-01 12:38:05 +05:30
pukkandan e0f2b4b47d
[utils] Fix slicing of reversed `LazyList`
Closes #589
2021-08-01 12:13:40 +05:30
pukkandan 7d1eb38af1
Add format types `j`, `l`, `q` for outtmpl
Closes #345
2021-07-29 08:47:25 +05:30
pukkandan 901130bbcf Expand and escape environment variables correctly in outtmpl
Fixes: https://www.reddit.com/r/youtubedl/comments/otfmq3/ytdlp_same_parameters_different_results
2021-07-29 08:38:18 +05:30
xtkoba cb89cfc14b
[test] Add Python 3.10 (#480)
Authored-by: pukkandan, xtkoba
2021-07-23 20:32:48 +05:30
pukkandan 352d63fdb5
[utils] Improve `traverse_obj` 2021-07-21 11:30:06 +05:30
pukkandan 6586bca9b9
[utils] Fix LazyList for Falsey values 2021-07-20 23:22:26 +05:30
pukkandan c634ad2a3c [compat] Remove unnecessary code 2021-07-20 03:46:05 +05:30
pukkandan 8f3343809e
[utils] Improve `traverse_obj`
* Allow skipping a level: `traverse_obj([{k:v1}, {k:v2}], (None, k))` => `[v1, v2]`
* Make keys variadic: `traverse_obj(obj, k1: str, k2: str)` => `traverse_obj(obj, (k1,), (k2,))`
* Fetch from multiple keys: `traverse_obj([{k1:[1], k2:[2], k3:[3]}], (0, (k1, k2), 0))` => `[1, 2]`

TODO: Add tests
2021-07-20 02:42:11 +05:30
felix c843e68588
[utils] Improve `js_to_json` comment regex
Capture the newline character as part of a single-line comment

From #497, Authored by: fstirlitz
2021-07-14 05:02:43 +05:30
pukkandan 325ebc1703
Improve `traverse_obj` 2021-07-11 04:46:53 +05:30
pukkandan 6606817a86
[utils] Add `variadic` 2021-07-11 04:46:51 +05:30
pukkandan 981052c9c6 Some minor fixes and refactoring (see desc)
* [utils] Fix issues with reversal
* check_formats should catch `DownloadError`, not `ExtractorError`
* Simplify format selectors with `LazyList` and `yield from`
2021-07-02 08:17:37 +05:30
pukkandan 51d9739f80
Add option `--throttled-rate` below which video data is re-extracted
Currently only for HTTP downloads

Closes #430, workaround for https://github.com/ytdl-org/youtube-dl/issues/29326
2021-06-23 05:29:58 +05:30
pukkandan 9fea350f0d
Fix id sanitization in filenames
Closes #415
2021-06-17 02:32:24 +05:30
felix cdb19aa4c2
[downloader/mhtml] Add new downloader (#343)
This downloader is intended to be used for streams that consist of a
timed sequence of stand-alone images, such as slideshows or thumbnail
streams

This can be used for implementing:

https://github.com/ytdl-org/youtube-dl/issues/4974#issue-58006762
https://github.com/ytdl-org/youtube-dl/issues/4540#issuecomment-69574231
https://github.com/ytdl-org/youtube-dl/pull/11185#issuecomment-335554239

https://github.com/ytdl-org/youtube-dl/issues/9868
https://github.com/ytdl-org/youtube-dl/pull/14951


Authored by: fstirlitz
2021-06-13 20:36:40 +05:30
pukkandan 28419ca2c8
[utils] Improve `LazyList`
* Add `repr` and `str` that mimics `list`
* Add `reversed`. Unlike `[::-1]`, reversed does not exhaust the iterable and modifies the `LazyList` in-place
* Add tests
2021-06-13 03:45:53 +05:30
pukkandan 639f1cea92
Fix `%d` and empty default in outtmpl
Closes #388
2021-06-09 15:37:15 +05:30
pukkandan 324ad82006
[utils] Generalize `traverse_dict` to `traverse_obj` 2021-06-08 19:26:44 +05:30
pukkandan 752cda3880
Fix and refactor `prepare_outtmpl`
The following tests would have failed previously:
%(id)d %(id)r
%(ext)s-%(ext|def)d
%(width|)d
%(id)r %(height)r
%(formats.0)r
%s
2021-06-06 00:59:04 +05:30
felix cc52de4356
[cleanup] Point all shebang to `python3` (#372)
Authored by: fstirlitz
2021-06-06 00:59:04 +05:30
pukkandan bc6b9bcd65
[utils] Escape URLs in `sanitized_Request`, not `sanitize_url`
d2558234cf added escaping of URLs while sanitizing. However, `sanitize_url` may not always receive an actual URL.
Eg: When using `yt-dlp "search query" --default-search ytsearch`, `search query` gets escaped to `search%20query` before being prefixed with `ytsearch:` which is not the intended behavior. So the escaping is moved to `sanitized_Request` instead.
2021-06-01 20:29:02 +05:30
pukkandan 55575225b4
[utils] Add `__getitem__` for `PagedList` 2021-05-29 02:12:08 +05:30
pukkandan 483336e79e
[utils] Add `LazyList` 2021-05-29 02:12:08 +05:30
Hubert Hirtz 5435dcf96e
Handle Basic Auth `user:pass` in URLs
Fixes https://github.com/ytdl-org/youtube-dl/issues/20258, https://github.com/ytdl-org/youtube-dl/issues/26211
Authored by: hhirtz, pukkandan
2021-05-24 03:38:02 +05:30
pukkandan 81a23040eb
[cleanup] Refactor ffmpeg convertors 2021-05-22 15:20:42 +05:30
king-millez 5014558ab9
[parlview] Add extractor (#322)
Authored by: king-millez
2021-05-20 18:35:37 +05:30
pukkandan 5112f26a60
Add `pl_thumbnail` outtmpl key for playlist thumbnails
This should have been implemented in 681de68e9d, but I forgot
2021-05-18 17:12:20 +05:30
pukkandan 2f567473c6
[Plugins] Prioritize plugins over standard extractors
and prevent plugins from overwriting the standard extractor classes

Closes #304
2021-05-09 04:22:27 +05:30
pukkandan e625be0d10
Improve output template internal formatting
* Allow slicing lists/strings using `field.start🔚step`
* A field can also be used as offset like `field1+num+field2`
* A default value can be given using `field|default`
* Capture all format strings and set it to `None` if invalid. This prevents invalid fields from causing errors
2021-05-06 20:28:58 +05:30
pukkandan 3158150cb7
[utils] Add `network_exceptions` 2021-05-04 22:36:18 +05:30
pukkandan d2558234cf
[utils] Escape URL while sanitizing
Closes #263

While this fixes the issue in question, it does not try to address the root-cause of the problem
Refer: 915f911e36, f5fa042c82
2021-04-29 05:20:50 +05:30