Commit Graph

1174 Commits (deae7c171180ddd4735c414306f084f86ef27e07)

Author SHA1 Message Date
pukkandan f82711587c
[cleanup] Sort imports
Using https://github.com/PyCQA/isort

    isort -m VERTICAL_HANGING_INDENT --py 36 -l 80 --rr -n --tc .
pukkandan 86e5f3ed2e
[cleanup] Upgrade syntax
Using https://github.com/asottile/pyupgrade

1. `__future__` imports and `coding: utf-8` were removed
2. Files were rewritten with `pyupgrade --py36-plus --keep-percent-format`
3. f-strings were cherry-picked from `pyupgrade --py36-plus`

Extractors are left untouched (except removing header) to avoid unnecessary merge conflicts
pukkandan f9934b9614
[cleanup] Mark some compat variables for removal ()
Authored by fstirlitz, pukkandan
felix cfb0511d82
[cleanup] Remove unused code paths ()
Notes:

* `_windows_write_string`: Fixed in 3.6
  * https://bugs.python.org/issue1602
  * PEP: https://www.python.org/dev/peps/pep-0528

* Windows UTF-8 fix: Fixed in 3.3
  * https://bugs.python.org/issue13216

* `__loader__`: is always present in 3.3+
  * https://bugs.python.org/issue14646

* `workaround_optparse_bug9161`: Fixed in 2.7
  * https://bugs.python.org/issue9161

Authored by: fstirlitz
felix ab96d1ad1b
[cleanup] Remove unused scripts/tests ()
Authored by fstirlitz, pukkandan
pukkandan b506289fe2
[test] Add `test_locked_file`
coletdev 1c1b2f96ae
[youtube:tab] Fix duration extraction for shorts ()
Related: https://github.com/TeamNewPipe/NewPipe/issues/8034
Authored-by: coletdjnz
pukkandan 5c3895fff1
[outtmpl] Limit changes during sanitization
Closes 
pukkandan 34baa9fdf0
[outtmpl] Fix replacement/default when used with alternate
pukkandan 6db9c4d57d
Ignore format-specific fields in initial pass of `--match-filter`
Closes 
s0u1h eeb2a770f3
[utils] `format_decimal_suffix`: Fix for very large numbers ()
Authored by: s0u1h
pukkandan 52efa4b312
[extractor] Add `_perform_login` function ()
* Adds new functions `_initialize_pre_login` and `_perform_login` as part of the extractor API
* Adds `ie.supports_login` to the public API
pukkandan 09b49e1f68
Add pre-processor stage `after_filter`
* Move `_match_entry` and `post_extract` to `process_video_result`. It is also left in `process_info` for API compat
* `--list-...` options and `--force-write-archive` now obey filtering options
* Move `SponsorBlockPP` to `after_filter`. Closes https://github.com/yt-dlp/yt-dlp/issues/2536
* Reverts 4ec82a72bb since this commit addresses the issue it was solving
MinePlayersPE c571b3a6ab
[youtube] Fix n-sig extraction for phone player JS ()
Authored by: MinePlayersPE
pukkandan 28469edd7d
Release 2022.02.03
pukkandan d5a398988b
Update to ytdl-commit-78ce962
[youtube] Support channel search
78ce962f4f
pukkandan 48416bc4a8
[youtube] Fix n-sig for player e06dea74
pukkandan 88f23a18e0
[docs,cleanup] Fix linter and misc cleanup
Closes 
pukkandan 6970b6005e
[cleanup] Minor fixes
Closes 
trasssh 4259402c56
[Ted] Rewrite extractor ()
Closes 
Authored by: pukkandan, trassshhub
pukkandan 8bd1c00bf3
[utils] Handle `ss:xxx` in `parse_duration`
Closes 
pukkandan f95a7b93e6
[test] Fix TestVerboseOutput
Closes 
Zenon Mousmoulas 0254f16274
[utils] Improve `get_elements_text_and_html_by_attribute` regex ()
Authored by: zmousm, pukkandan
pukkandan 976ae3eabb
[youtube] Update tests
Zenon Mousmoulas 6f32a0b5b7
[utils] Improve parsing for nested HTML elements ()
and add functions to return the HTML of elements

Authored by: zmousm
pukkandan 9e907ebddf
[cleanup] Misc cleanup
pukkandan 06e57990f7
Allow multiple and nested configuration files
pukkandan f46e2f9d92
Add key `requested_downloads` in the root `info_dict`
chris f522573787
[extractor] Extract chapters from JSON-LD ()
Authored by: iw0nderhow, pukkandan
nixxo 7592749cbe
[extractor] Extract thumbnails from JSON-LD ()
Authored by: nixxo
Ashish Gupta 497d77e1aa
[KelbyOne] Add extractor ()
Closes 
Authored by: Ashish0804
pukkandan abbeeebc4c
[outtmpl] Alternate form for `D` and fix suffix's case
Fixes: https://github.com/yt-dlp/yt-dlp/issues/2085#issuecomment-1002247689, https://github.com/yt-dlp/yt-dlp/pull/2132/files#r775729811
Pierre Mdawar f02d24d8d2
[utils] Fix `format_bytes` output for Bytes ()
Authored by: pukkandan, mdawar
Matt Broadway f59f5ef8b6
[cookies] Support other keyrings ()
Authored by: mbway
pukkandan 352d5da812
[utils] Improve `parse_count`
pukkandan 37893bb0c9
[outtmpl] Change filename sanitization type to `S`
`F` is already used for float!
Bug in e0fd95737d
pukkandan b69fd25c25
[cleanup] Misc cleanup
Closes     
pukkandan e0fd95737d
[outtmpl] Add alternate forms `F`, `D`
and improve `id` detection

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

Closes , 2081
pukkandan 75ad33572b
[test/download] Split `sanitize_got_info_dict` into a separate function
so that it can be used by third party scripts
PilzAdam e978789f0f
[outtmpl] Add operator `&` for replacement text ()
Authored by: PilzAdam
Zenon Mousmoulas d5c3254889
[extractor] Support default implicit graph in JSON-LD ()
Original PR: https://github.com/ytdl-org/youtube-dl/pull/30229

Per W3C JSON-LD v1.1 §4.9 (non-normative ref):

    When a JSON-LD document's top-level structure is a map that contains
    no other keys than @graph and optionally @context (properties that
    are not mapped to an IRI or a keyword are ignored), @graph is
    considered to express the otherwise implicit default graph.

Authored by: zmousm
std-move fed1309651
[test/download] Ignore field `webpage_url_domain` ()
Authored by: std-move
pukkandan ff9f925b63
[test/download] Add more fields
Nil Admirari 8157a09d22
[SponsorBlock] Add Filler and Highlight categories ()
Authored by: nihil-admirari, pukkandan
pukkandan 57dbe8077f
[jsinterp] Fix splice to handle float
Needed for new youtube js player f1ca6900
Closes 
pukkandan 282f570918
[utils] Fix error when copying `LazyList`
pukkandan c5e3f84972
[utils] Allow alignment in `render_table`
and add tests
The Hatsune Daishi a04e005521
[AES] Add ECB mode ()
Needed for 
Authored by: nao20010128nao
pukkandan dd2a987d3f
[tests] Fix tests
pukkandan 9222c38182
[cleanup] Minor cleanup
Closes , Closes 
pukkandan 4476d2c764
[outtmpl] Add alternate forms for `q` and `j`
pukkandan 582fad70f5
[outtmpl] Do not traverse `None`
Closes 
pukkandan a331949df3
[test/download] Fallback test to `bv`
pukkandan a1fc7ca074
[jsinterp] Handle default in switch better
pukkandan 404f611f1c
[youtube] Fix throttling by decrypting n-sig ()
Damiano Amatruda 17ec8bcfa9
[microsoftstream] Add extractor ()
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
pukkandan aa7785f860
[utils] Standardize timestamp formatting code
Closes 
pukkandan 176f1866cb
Add HDR information to formats
pukkandan 17bddf3e95
Reduce default `--socket-timeout`
pukkandan 18f96d129b
[utils] Allow duration strings in filter
Closes 
pukkandan b836dc94f2
[outtmpl] Fix bug in expanding environment variables
pukkandan b5ae35ee6d
[cleanup] Misc cleanup
pukkandan 819e05319b
Improved progress reporting (See desc) ()
* 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: , , , 
pukkandan e6f21b3d92
[docs,cleanup] Some minor refactoring and improve docs
pukkandan 91dd88b90f
[outtmpl] Alternate form of format type `l` for `\n` delimited list
pukkandan 524e2e4fda
[outtmpl] Format type `U` for unicode normalization
pukkandan ff1c7fc9d3
Allow `0` in `--playlist-items`
pukkandan 1b629e1b4c
[test/cookies] Improve logging
Ákos Sülyi 09906f554d
[aes] Add `aes_gcm_decrypt_and_verify` ()
Authored by: sulyi, pukkandan
Nil Admirari c6af2dd8e5
[SponsorBlock] Improve merge algorithm ()
Authored by: nihil-admirari
pukkandan 7c37ff97d3
Allow alternate fields in outtmpl
Closes , 
pukkandan edf65256aa
[hls,aes] Fallback to native implementation for AES-CBC
and detect `Cryptodome` in addition to `Crypto`

Closes 
Related: 
pukkandan f5aa5cfbff
Add format type `B` for outtmpl to treat the value as bytes
This is useful to limit the filename to a certain number of bytes rather than characters
Closes 
coletdjnz a7e999beec
[pbs] Fix subtitle extraction ()
Original PR: https://github.com/ytdl-org/youtube-dl/pull/24430, https://github.com/ytdl-org/youtube-dl/pull/17434
Closes: , https://github.com/ytdl-org/youtube-dl/issues/18796, https://github.com/ytdl-org/youtube-dl/issues/17273
Authored-by: coletdjnz, gesa, raphaeldore
Nil Admirari 7a340e0df3
Native SponsorBlock implementation and related improvements ()
SponsorBlock options:
* The fetched sponsor sections are written to infojson
* `--sponsorblock-remove` removes specified chapters from file
* `--sponsorblock-mark` marks the specified sponsor sections as chapters
* `--sponsorblock-chapter-title` to specify sponsor chapter template
* `--sponsorblock-api` to use a different API

Related improvements:
* Split `--embed-chapters` from `--embed-metadata`
* Add `--remove-chapters` to remove arbitrary chapters
* Add `--force-keyframes-at-cuts` for more accurate cuts when removing and splitting chapters

Deprecates all `--sponskrub` options

Authored by: nihil-admirari, pukkandan
animelover1984 abafce59a1
[Niconico] Add Search extractors ()
Authored by: animelover1984, pukkandan
coletdjnz 0bb1bc1b10
[youtube] Remove annotations and deprecate `--write-annotations` ()
Closes  
Authored by: coletdjnz
pukkandan 4dfbf8696b
[utils] Add `parse_qs`
pukkandan 9e598870dd
Fix `playlist_index` not obeying `playlist_start`
and add tests
Closes 
pukkandan 8f18aca871
Let `--match-filter` reject entries early
Makes redundant: `--match-title`, `--reject-title`, `--min-views`, `--max-views`
pukkandan ad3dc496bb Misc fixes - See desc
* Remove unnecessary uses of _list_from_options_callback
* Fix download tests - Bug from 6e84b21559
* Rename ExecAfterDownloadPP to ExecPP and refactor its tests
* Ensure _write_ytdl_file closes file handle on error - Potential fix for 
pukkandan e9f4ccd19e
Add option `--replace-in-metadata`
pukkandan b868936cd6 [cleanup] Misc
pukkandan 243c57cfe8 [tests:download] Add batch testing for extractors
Use `test_YourExtractor_all` to invoke them
pukkandan 2b8a2973bd Allow entire infodict to be printed using `%()s`
Makes `--dump-json` redundant
pukkandan 6e84b21559
Fix bugs related to `sanitize_info`
Related: 8012d892bd (r54555230)
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
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
pukkandan 0855702f3f
[test:download] Support testing with `ignore_no_formats_error`
pukkandan e0f2b4b47d
[utils] Fix slicing of reversed `LazyList`
Closes 
pukkandan 7d1eb38af1
Add format types `j`, `l`, `q` for outtmpl
Closes 
pukkandan 901130bbcf Expand and escape environment variables correctly in outtmpl
Fixes: https://www.reddit.com/r/youtubedl/comments/otfmq3/ytdlp_same_parameters_different_results
pukkandan 052e135029
[youtube] Simplify `_get_text` early
pukkandan 060ac76257
[test] Use `pytest` instead of `nosetests` ()
`nosetests` is no longer being maintained : https://github.com/nose-devs/nose/issues/1099
and will stop working in py 3.10 as can be seen in 
Matt Broadway 982ee69a74
Add option `--cookies-from-browser` to load cookies from a browser ()
* also adds `--no-cookies-from-browser`

Original PR: https://github.com/ytdl-org/youtube-dl/pull/29201
Authored by: mbway
felix c843e68588
[utils] Improve `js_to_json` comment regex
Capture the newline character as part of a single-line comment

From , Authored by: fstirlitz
pukkandan b5ac45b197
Fix selectors `all`, `mergeall` and add tests
Bug from: 981052c9c6
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`
pukkandan 9fea350f0d
Fix id sanitization in filenames
Closes 
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