diff options
54 files changed, 702 insertions, 3664 deletions
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 04de08708..000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,13 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username - -custom: ['https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators'] diff --git a/.github/ISSUE_TEMPLATE/1_broken_site.yml b/.github/ISSUE_TEMPLATE/1_broken_site.yml deleted file mode 100644 index dd1b33dde..000000000 --- a/.github/ISSUE_TEMPLATE/1_broken_site.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Broken site support -description: Report issue with yt-dlp on a supported site -labels: [triage, site-bug] -body: - - type: checkboxes - attributes: - label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE - description: Fill all fields even if you think it is irrelevant for the issue - options: - - label: I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field - required: true - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm reporting that yt-dlp is broken on a **supported** site - required: true - - label: I've verified that I'm running yt-dlp version **2023.07.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've checked that all provided URLs are playable in a browser with the same IP and same login details - required: true - - label: I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command) - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - label: I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required - - type: input - id: region - attributes: - label: Region - description: Enter the country/region that the site is accessible from - placeholder: India - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - - type: checkboxes - id: verbose - attributes: - label: Provide verbose output that clearly demonstrates the problem - options: - - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`) - required: true - - label: "If using API, add `'verbose': True` to `YoutubeDL` params instead" - required: false - - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below - required: true - - type: textarea - id: log - attributes: - label: Complete Verbose Output - description: | - It should start like this: - placeholder: | - [debug] Command-line config: ['-vU', 'test:youtube'] - [debug] Portable config "yt-dlp.conf": ['-i'] - [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8 - [debug] yt-dlp version 2023.07.06 [9d339c4] (win32_exe) - [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0 - [debug] Checking exe version: ffmpeg -bsfs - [debug] Checking exe version: ffprobe -bsfs - [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1 - [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3 - [debug] Proxy map: {} - [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest - Latest version: 2023.07.06, Current version: 2023.07.06 - yt-dlp is up to date (2023.07.06) - <more lines> - render: shell - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/2_site_support_request.yml b/.github/ISSUE_TEMPLATE/2_site_support_request.yml deleted file mode 100644 index 4f4378924..000000000 --- a/.github/ISSUE_TEMPLATE/2_site_support_request.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Site support request -description: Request support for a new site -labels: [triage, site-request] -body: - - type: checkboxes - attributes: - label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE - description: Fill all fields even if you think it is irrelevant for the issue - options: - - label: I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field - required: true - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm reporting a new site support request - required: true - - label: I've verified that I'm running yt-dlp version **2023.07.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've checked that all provided URLs are playable in a browser with the same IP and same login details - required: true - - label: I've checked that none of provided URLs [violate any copyrights](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-website-primarily-used-for-piracy) or contain any [DRM](https://en.wikipedia.org/wiki/Digital_rights_management) to the best of my knowledge - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - label: I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and am willing to share it if required - - type: input - id: region - attributes: - label: Region - description: Enter the country/region that the site is accessible from - placeholder: India - - type: textarea - id: example-urls - attributes: - label: Example URLs - description: | - Provide all kinds of example URLs for which support should be added - placeholder: | - - Single video: https://www.youtube.com/watch?v=BaW_jenozKc - - Single video: https://youtu.be/BaW_jenozKc - - Playlist: https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc - validations: - required: true - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - - type: checkboxes - id: verbose - attributes: - label: Provide verbose output that clearly demonstrates the problem - options: - - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`) - required: true - - label: "If using API, add `'verbose': True` to `YoutubeDL` params instead" - required: false - - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below - required: true - - type: textarea - id: log - attributes: - label: Complete Verbose Output - description: | - It should start like this: - placeholder: | - [debug] Command-line config: ['-vU', 'test:youtube'] - [debug] Portable config "yt-dlp.conf": ['-i'] - [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8 - [debug] yt-dlp version 2023.07.06 [9d339c4] (win32_exe) - [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0 - [debug] Checking exe version: ffmpeg -bsfs - [debug] Checking exe version: ffprobe -bsfs - [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1 - [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3 - [debug] Proxy map: {} - [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest - Latest version: 2023.07.06, Current version: 2023.07.06 - yt-dlp is up to date (2023.07.06) - <more lines> - render: shell - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/3_site_feature_request.yml b/.github/ISSUE_TEMPLATE/3_site_feature_request.yml deleted file mode 100644 index 05b4dd23b..000000000 --- a/.github/ISSUE_TEMPLATE/3_site_feature_request.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Site feature request -description: Request a new functionality for a supported site -labels: [triage, site-enhancement] -body: - - type: checkboxes - attributes: - label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE - description: Fill all fields even if you think it is irrelevant for the issue - options: - - label: I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field - required: true - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm requesting a site-specific feature - required: true - - label: I've verified that I'm running yt-dlp version **2023.07.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've checked that all provided URLs are playable in a browser with the same IP and same login details - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - label: I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required - - type: input - id: region - attributes: - label: Region - description: Enter the country/region that the site is accessible from - placeholder: India - - type: textarea - id: example-urls - attributes: - label: Example URLs - description: | - Example URLs that can be used to demonstrate the requested feature - placeholder: | - https://www.youtube.com/watch?v=BaW_jenozKc - validations: - required: true - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - - type: checkboxes - id: verbose - attributes: - label: Provide verbose output that clearly demonstrates the problem - options: - - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`) - required: true - - label: "If using API, add `'verbose': True` to `YoutubeDL` params instead" - required: false - - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below - required: true - - type: textarea - id: log - attributes: - label: Complete Verbose Output - description: | - It should start like this: - placeholder: | - [debug] Command-line config: ['-vU', 'test:youtube'] - [debug] Portable config "yt-dlp.conf": ['-i'] - [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8 - [debug] yt-dlp version 2023.07.06 [9d339c4] (win32_exe) - [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0 - [debug] Checking exe version: ffmpeg -bsfs - [debug] Checking exe version: ffprobe -bsfs - [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1 - [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3 - [debug] Proxy map: {} - [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest - Latest version: 2023.07.06, Current version: 2023.07.06 - yt-dlp is up to date (2023.07.06) - <more lines> - render: shell - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/4_bug_report.yml b/.github/ISSUE_TEMPLATE/4_bug_report.yml deleted file mode 100644 index 880f1014c..000000000 --- a/.github/ISSUE_TEMPLATE/4_bug_report.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Core bug report -description: Report a bug unrelated to any particular site or extractor -labels: [triage, bug] -body: - - type: checkboxes - attributes: - label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE - description: Fill all fields even if you think it is irrelevant for the issue - options: - - label: I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field - required: true - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm reporting a bug unrelated to a specific site - required: true - - label: I've verified that I'm running yt-dlp version **2023.07.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've checked that all provided URLs are playable in a browser with the same IP and same login details - required: true - - label: I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command) - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - - type: checkboxes - id: verbose - attributes: - label: Provide verbose output that clearly demonstrates the problem - options: - - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`) - required: true - - label: "If using API, add `'verbose': True` to `YoutubeDL` params instead" - required: false - - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below - required: true - - type: textarea - id: log - attributes: - label: Complete Verbose Output - description: | - It should start like this: - placeholder: | - [debug] Command-line config: ['-vU', 'test:youtube'] - [debug] Portable config "yt-dlp.conf": ['-i'] - [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8 - [debug] yt-dlp version 2023.07.06 [9d339c4] (win32_exe) - [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0 - [debug] Checking exe version: ffmpeg -bsfs - [debug] Checking exe version: ffprobe -bsfs - [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1 - [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3 - [debug] Proxy map: {} - [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest - Latest version: 2023.07.06, Current version: 2023.07.06 - yt-dlp is up to date (2023.07.06) - <more lines> - render: shell - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/5_feature_request.yml b/.github/ISSUE_TEMPLATE/5_feature_request.yml deleted file mode 100644 index acb11795f..000000000 --- a/.github/ISSUE_TEMPLATE/5_feature_request.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Feature request -description: Request a new functionality unrelated to any particular site or extractor -labels: [triage, enhancement] -body: - - type: checkboxes - attributes: - label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE - description: Fill all fields even if you think it is irrelevant for the issue - options: - - label: I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field - required: true - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm requesting a feature unrelated to a specific site - required: true - - label: I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme) - required: true - - label: I've verified that I'm running yt-dlp version **2023.07.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - - type: checkboxes - id: verbose - attributes: - label: Provide verbose output that clearly demonstrates the problem - options: - - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`) - - label: "If using API, add `'verbose': True` to `YoutubeDL` params instead" - required: false - - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below - - type: textarea - id: log - attributes: - label: Complete Verbose Output - description: | - It should start like this: - placeholder: | - [debug] Command-line config: ['-vU', 'test:youtube'] - [debug] Portable config "yt-dlp.conf": ['-i'] - [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8 - [debug] yt-dlp version 2023.07.06 [9d339c4] (win32_exe) - [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0 - [debug] Checking exe version: ffmpeg -bsfs - [debug] Checking exe version: ffprobe -bsfs - [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1 - [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3 - [debug] Proxy map: {} - [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest - Latest version: 2023.07.06, Current version: 2023.07.06 - yt-dlp is up to date (2023.07.06) - <more lines> - render: shell diff --git a/.github/ISSUE_TEMPLATE/6_question.yml b/.github/ISSUE_TEMPLATE/6_question.yml deleted file mode 100644 index a2563e975..000000000 --- a/.github/ISSUE_TEMPLATE/6_question.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Ask question -description: Ask yt-dlp related question -labels: [question] -body: - - type: checkboxes - attributes: - label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE - description: Fill all fields even if you think it is irrelevant for the issue - options: - - label: I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field - required: true - - type: markdown - attributes: - value: | - ### Make sure you are **only** asking a question and not reporting a bug or requesting a feature. - If your question contains "isn't working" or "can you add", this is most likely the wrong template. - If you are in doubt whether this is the right template, **USE ANOTHER TEMPLATE**! - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm asking a question and **not** reporting a bug or requesting a feature - required: true - - label: I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme) - required: true - - label: I've verified that I'm running yt-dlp version **2023.07.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - type: textarea - id: question - attributes: - label: Please make sure the question is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information and as much context and examples as possible - validations: - required: true - - type: checkboxes - id: verbose - attributes: - label: Provide verbose output that clearly demonstrates the problem - options: - - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`) - - label: "If using API, add `'verbose': True` to `YoutubeDL` params instead" - required: false - - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below - - type: textarea - id: log - attributes: - label: Complete Verbose Output - description: | - It should start like this: - placeholder: | - [debug] Command-line config: ['-vU', 'test:youtube'] - [debug] Portable config "yt-dlp.conf": ['-i'] - [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8 - [debug] yt-dlp version 2023.07.06 [9d339c4] (win32_exe) - [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0 - [debug] Checking exe version: ffmpeg -bsfs - [debug] Checking exe version: ffprobe -bsfs - [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1 - [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3 - [debug] Proxy map: {} - [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest - Latest version: 2023.07.06, Current version: 2023.07.06 - yt-dlp is up to date (2023.07.06) - <more lines> - render: shell diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 9cdffa4b1..000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Get help from the community on Discord - url: https://discord.gg/H5MNcFW63r - about: Join the yt-dlp Discord for community-powered support! - - name: Matrix Bridge to the Discord server - url: https://matrix.to/#/#yt-dlp:matrix.org - about: For those who do not want to use Discord diff --git a/.github/ISSUE_TEMPLATE_tmpl/1_broken_site.yml b/.github/ISSUE_TEMPLATE_tmpl/1_broken_site.yml deleted file mode 100644 index a51db789f..000000000 --- a/.github/ISSUE_TEMPLATE_tmpl/1_broken_site.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Broken site support -description: Report issue with yt-dlp on a supported site -labels: [triage, site-bug] -body: - %(no_skip)s - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm reporting that yt-dlp is broken on a **supported** site - required: true - - label: I've verified that I'm running yt-dlp version **%(version)s** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've checked that all provided URLs are playable in a browser with the same IP and same login details - required: true - - label: I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command) - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - label: I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required - - type: input - id: region - attributes: - label: Region - description: Enter the country/region that the site is accessible from - placeholder: India - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - %(verbose)s diff --git a/.github/ISSUE_TEMPLATE_tmpl/2_site_support_request.yml b/.github/ISSUE_TEMPLATE_tmpl/2_site_support_request.yml deleted file mode 100644 index 75d62e7bb..000000000 --- a/.github/ISSUE_TEMPLATE_tmpl/2_site_support_request.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Site support request -description: Request support for a new site -labels: [triage, site-request] -body: - %(no_skip)s - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm reporting a new site support request - required: true - - label: I've verified that I'm running yt-dlp version **%(version)s** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've checked that all provided URLs are playable in a browser with the same IP and same login details - required: true - - label: I've checked that none of provided URLs [violate any copyrights](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-website-primarily-used-for-piracy) or contain any [DRM](https://en.wikipedia.org/wiki/Digital_rights_management) to the best of my knowledge - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - label: I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and am willing to share it if required - - type: input - id: region - attributes: - label: Region - description: Enter the country/region that the site is accessible from - placeholder: India - - type: textarea - id: example-urls - attributes: - label: Example URLs - description: | - Provide all kinds of example URLs for which support should be added - placeholder: | - - Single video: https://www.youtube.com/watch?v=BaW_jenozKc - - Single video: https://youtu.be/BaW_jenozKc - - Playlist: https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc - validations: - required: true - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - %(verbose)s diff --git a/.github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.yml b/.github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.yml deleted file mode 100644 index 18b30f578..000000000 --- a/.github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Site feature request -description: Request a new functionality for a supported site -labels: [triage, site-enhancement] -body: - %(no_skip)s - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm requesting a site-specific feature - required: true - - label: I've verified that I'm running yt-dlp version **%(version)s** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've checked that all provided URLs are playable in a browser with the same IP and same login details - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - label: I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required - - type: input - id: region - attributes: - label: Region - description: Enter the country/region that the site is accessible from - placeholder: India - - type: textarea - id: example-urls - attributes: - label: Example URLs - description: | - Example URLs that can be used to demonstrate the requested feature - placeholder: | - https://www.youtube.com/watch?v=BaW_jenozKc - validations: - required: true - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - %(verbose)s diff --git a/.github/ISSUE_TEMPLATE_tmpl/4_bug_report.yml b/.github/ISSUE_TEMPLATE_tmpl/4_bug_report.yml deleted file mode 100644 index 9ab490267..000000000 --- a/.github/ISSUE_TEMPLATE_tmpl/4_bug_report.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Core bug report -description: Report a bug unrelated to any particular site or extractor -labels: [triage, bug] -body: - %(no_skip)s - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm reporting a bug unrelated to a specific site - required: true - - label: I've verified that I'm running yt-dlp version **%(version)s** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've checked that all provided URLs are playable in a browser with the same IP and same login details - required: true - - label: I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command) - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - %(verbose)s diff --git a/.github/ISSUE_TEMPLATE_tmpl/5_feature_request.yml b/.github/ISSUE_TEMPLATE_tmpl/5_feature_request.yml deleted file mode 100644 index ef3bb2269..000000000 --- a/.github/ISSUE_TEMPLATE_tmpl/5_feature_request.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Feature request -description: Request a new functionality unrelated to any particular site or extractor -labels: [triage, enhancement] -body: - %(no_skip)s - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm requesting a feature unrelated to a specific site - required: true - - label: I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme) - required: true - - label: I've verified that I'm running yt-dlp version **%(version)s** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - type: textarea - id: description - attributes: - label: Provide a description that is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information, any suggested solutions, and as much context and examples as possible - validations: - required: true - %(verbose_optional)s diff --git a/.github/ISSUE_TEMPLATE_tmpl/6_question.yml b/.github/ISSUE_TEMPLATE_tmpl/6_question.yml deleted file mode 100644 index 4bef82d5a..000000000 --- a/.github/ISSUE_TEMPLATE_tmpl/6_question.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Ask question -description: Ask yt-dlp related question -labels: [question] -body: - %(no_skip)s - - type: markdown - attributes: - value: | - ### Make sure you are **only** asking a question and not reporting a bug or requesting a feature. - If your question contains "isn't working" or "can you add", this is most likely the wrong template. - If you are in doubt whether this is the right template, **USE ANOTHER TEMPLATE**! - - type: checkboxes - id: checklist - attributes: - label: Checklist - description: | - Carefully read and work through this check list in order to prevent the most common mistakes and misuse of yt-dlp: - options: - - label: I'm asking a question and **not** reporting a bug or requesting a feature - required: true - - label: I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme) - required: true - - label: I've verified that I'm running yt-dlp version **%(version)s** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit) - required: true - - label: I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions **including closed ones**. DO NOT post duplicates - required: true - - label: I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue) - required: true - - type: textarea - id: question - attributes: - label: Please make sure the question is worded well enough to be understood - description: See [is-the-description-of-the-issue-itself-sufficient](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-description-of-the-issue-itself-sufficient) - placeholder: Provide any additional information and as much context and examples as possible - validations: - required: true - %(verbose_optional)s diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index cbed82173..000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,49 +0,0 @@ -**IMPORTANT**: PRs without the template will be CLOSED - -### Description of your *pull request* and other information - -<!-- - -Explanation of your *pull request* in arbitrary form goes here. Please **make sure the description explains the purpose and effect** of your *pull request* and is worded well enough to be understood. Provide as much **context and examples** as possible - ---> - -ADD DESCRIPTION HERE - -Fixes # - - -<details open><summary>Template</summary> <!-- OPEN is intentional --> - -<!-- - -# PLEASE FOLLOW THE GUIDE BELOW - -- You will be asked some questions, please read them **carefully** and answer honestly -- Put an `x` into all the boxes `[ ]` relevant to your *pull request* (like [x]) -- Use *Preview* tab to see how your *pull request* will actually look like - ---> - -### Before submitting a *pull request* make sure you have: -- [ ] At least skimmed through [contributing guidelines](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#developer-instructions) including [yt-dlp coding conventions](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#yt-dlp-coding-conventions) -- [ ] [Searched](https://github.com/yt-dlp/yt-dlp/search?q=is%3Apr&type=Issues) the bugtracker for similar pull requests -- [ ] Checked the code with [flake8](https://pypi.python.org/pypi/flake8) and [ran relevant tests](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#developer-instructions) - -### In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under [Unlicense](http://unlicense.org/). Check all of the following options that apply: -- [ ] I am the original author of this code and I am willing to release it under [Unlicense](http://unlicense.org/) -- [ ] I am not the original author of this code but it is in public domain or released under [Unlicense](http://unlicense.org/) (provide reliable evidence) - -### What is the purpose of your *pull request*? -- [ ] Fix or improvement to an extractor (Make sure to add/update tests) -- [ ] New extractor ([Piracy websites will not be accepted](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-website-primarily-used-for-piracy)) -- [ ] Core bug fix/improvement -- [ ] New feature (It is strongly [recommended to open an issue first](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#adding-new-feature-or-making-overarching-changes)) - - -<!-- Do NOT edit/remove anything below this! --> -</details><details><summary>Copilot Summary</summary> - -copilot:all - -</details> diff --git a/.github/banner.svg b/.github/banner.svg deleted file mode 100644 index 35dc93eae..000000000 --- a/.github/banner.svg +++ /dev/null @@ -1,31 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid" width="699.935" height="173.764" viewBox="0 0 717 178"> - <defs> - <style> - .cls-1, .cls-4 { - fill: red; - } - - .cls-1, .cls-2, .cls-3, .cls-4 { - fill-rule: evenodd; - } - - .cls-2 { - fill: #666; - } - - .cls-3 { - fill: #fff; - } - - .cls-3, .cls-4 { - stroke: #282828; - stroke-linejoin: round; - stroke-width: 1px; - } - </style> - </defs> - <path d="M89.846,166.601 L87.111,166.601 L87.111,172.000 L82.173,172.000 L82.173,153.812 L90.024,153.812 C94.064,153.812 96.773,156.370 96.773,160.242 C96.773,164.158 93.993,166.601 89.846,166.601 ZM88.851,157.755 L87.111,157.755 L87.111,162.764 L88.851,162.764 C90.583,162.764 91.622,161.796 91.622,160.242 C91.622,158.679 90.583,157.755 88.851,157.755 ZM67.898,153.812 L72.835,153.812 L72.835,168.021 L80.189,168.021 L80.189,172.000 L67.898,172.000 L67.898,153.812 ZM56.572,172.000 L49.574,172.000 L49.574,153.812 L56.501,153.812 C62.113,153.812 65.630,157.223 65.630,162.906 C65.630,168.590 62.113,172.000 56.572,172.000 ZM56.252,158.004 L54.511,158.004 L54.511,167.808 L56.394,167.808 C59.094,167.808 60.657,166.707 60.657,162.906 C60.657,159.105 59.094,158.004 56.252,158.004 ZM38.211,162.906 L46.736,162.906 L46.736,166.601 L38.211,166.601 L38.211,162.906 ZM31.253,172.000 L26.387,172.000 L26.387,157.791 L20.916,157.791 L20.916,153.812 L36.724,153.812 L36.724,157.791 L31.253,157.791 L31.253,172.000 ZM12.007,172.000 L7.104,172.000 L7.104,166.281 L0.426,153.812 L5.932,153.812 L9.484,161.201 L9.627,161.201 L13.179,153.812 L18.685,153.812 L12.007,166.281 L12.007,172.000 Z" class="cls-1"/> - <path d="M714.317,161.947 C714.104,160.988 713.536,159.993 711.689,159.993 C710.019,159.993 708.634,160.846 708.456,162.018 C708.278,163.048 708.918,163.617 710.445,164.007 L712.399,164.505 C714.743,165.109 715.738,166.281 715.418,168.199 C715.028,170.544 712.577,172.284 709.415,172.284 C706.609,172.284 704.904,171.041 704.797,168.732 L706.893,168.235 C707.000,169.691 707.959,170.437 709.664,170.437 C711.617,170.437 713.038,169.478 713.216,168.306 C713.394,167.347 712.861,166.707 711.511,166.387 L709.344,165.855 C706.928,165.251 706.005,164.007 706.325,162.125 C706.715,159.816 709.131,158.182 712.008,158.182 C714.708,158.182 715.951,159.461 716.306,161.414 L714.317,161.947 ZM702.671,165.890 L692.751,165.890 C692.245,169.229 693.648,170.401 696.276,170.401 C697.955,170.401 699.269,169.691 700.042,168.270 L701.960,168.838 C700.974,170.899 698.736,172.284 695.957,172.284 C692.023,172.284 690.069,169.478 690.770,165.286 C691.454,161.095 694.403,158.182 698.088,158.182 C700.939,158.182 703.674,159.922 702.813,165.002 L702.671,165.890 ZM697.768,160.064 C695.477,160.064 693.461,162.143 693.044,164.078 L700.823,164.078 C701.223,161.770 700.051,160.064 697.768,160.064 ZM687.862,172.000 L685.446,172.000 L683.066,166.707 L678.910,172.000 L676.494,172.000 L681.965,165.180 L678.768,158.359 L681.183,158.359 L683.528,163.936 L687.720,158.359 L690.135,158.359 L684.594,165.180 L687.862,172.000 ZM673.886,154.630 C673.886,153.848 674.560,153.209 675.377,153.209 C676.194,153.209 676.869,153.848 676.869,154.630 C676.869,155.411 676.194,156.050 675.377,156.050 C674.560,156.050 673.886,155.411 673.886,154.630 ZM673.513,172.000 L671.417,172.000 L673.690,158.359 L675.786,158.359 L673.513,172.000 ZM670.212,154.914 C668.826,154.914 668.151,155.624 667.903,156.974 L667.672,158.359 L670.745,158.359 L670.460,160.135 L667.379,160.135 L665.416,172.000 L663.320,172.000 L665.301,160.135 L663.107,160.135 L663.391,158.359 L665.603,158.359 L665.914,156.477 C666.269,154.132 668.365,152.960 670.318,152.960 C671.348,152.960 671.952,153.173 672.237,153.315 L671.348,155.127 C671.135,155.056 670.816,154.914 670.212,154.914 ZM649.225,172.000 L649.580,169.904 L649.332,169.904 C648.745,170.650 647.582,172.284 644.962,172.284 C641.543,172.284 639.616,169.549 640.327,165.215 C641.046,160.917 643.879,158.182 647.324,158.182 C649.989,158.182 650.539,159.816 650.877,160.526 L651.054,160.526 L652.173,153.812 L654.269,153.812 L651.250,172.000 L649.225,172.000 ZM647.182,160.064 C644.527,160.064 642.911,162.302 642.440,165.180 C641.952,168.093 642.849,170.401 645.477,170.401 C647.999,170.401 649.811,168.270 650.326,165.180 C650.832,162.125 649.749,160.064 647.182,160.064 ZM635.980,172.000 L633.884,172.000 L635.305,163.475 C635.660,161.343 634.701,160.064 632.747,160.064 C630.723,160.064 629.053,161.414 628.627,163.794 L627.277,172.000 L625.181,172.000 L627.454,158.359 L629.479,158.359 L629.124,160.491 L629.302,160.491 C630.154,159.105 631.611,158.182 633.671,158.182 C636.406,158.182 638.005,159.851 637.436,163.333 L635.980,172.000 ZM621.349,172.000 L619.253,172.000 L619.573,170.153 L619.466,170.153 C618.898,171.041 617.442,172.320 615.062,172.320 C612.468,172.320 610.657,170.792 611.083,168.128 C611.616,165.002 614.458,164.434 617.051,164.114 C619.573,163.794 620.603,163.865 620.781,162.871 L620.781,162.800 C621.065,161.059 620.354,160.029 618.436,160.029 C616.447,160.029 615.097,161.095 614.458,162.089 L612.611,161.379 C614.067,158.892 616.554,158.182 618.614,158.182 C620.354,158.182 623.551,158.679 622.841,163.013 L621.349,172.000 ZM616.660,165.926 C614.991,166.139 613.428,166.636 613.179,168.235 C612.930,169.691 613.996,170.437 615.665,170.437 C618.152,170.437 619.786,168.767 620.070,167.062 L620.390,165.144 C619.964,165.570 617.548,165.819 616.660,165.926 ZM597.804,159.993 C596.135,159.993 594.749,160.846 594.572,162.018 C594.394,163.048 595.033,163.617 596.561,164.007 L598.515,164.505 C600.859,165.109 601.854,166.281 601.534,168.199 C601.143,170.544 598.692,172.284 595.531,172.284 C592.724,172.284 591.019,171.041 590.913,168.732 L593.009,168.235 C593.115,169.691 594.074,170.437 595.779,170.437 C597.733,170.437 599.154,169.478 599.332,168.306 C599.509,167.347 598.976,166.707 597.627,166.387 L595.460,165.855 C593.044,165.251 592.121,164.007 592.440,162.125 C592.831,159.816 595.247,158.182 598.124,158.182 C600.824,158.182 602.067,159.461 602.422,161.414 L600.433,161.947 C600.220,160.988 599.651,159.993 597.804,159.993 ZM588.786,165.890 L578.866,165.890 C578.360,169.229 579.763,170.401 582.392,170.401 C584.071,170.401 585.385,169.691 586.157,168.270 L588.076,168.838 C587.090,170.899 584.852,172.284 582.072,172.284 C578.138,172.284 576.185,169.478 576.886,165.286 C577.570,161.095 580.518,158.182 584.204,158.182 C587.054,158.182 589.790,159.922 588.928,165.002 L588.786,165.890 ZM583.884,160.064 C581.593,160.064 579.577,162.143 579.160,164.078 L586.939,164.078 C587.339,161.770 586.166,160.064 583.884,160.064 ZM574.722,160.171 C572.733,160.171 571.046,161.530 570.744,163.368 L569.323,172.000 L567.227,172.000 L569.500,158.359 L571.525,158.359 L571.170,160.420 L571.312,160.420 C572.023,159.070 573.586,158.146 575.255,158.146 C576.001,158.146 576.534,158.324 576.889,158.644 L575.894,160.384 C575.646,160.242 575.255,160.171 574.722,160.171 ZM561.299,172.000 L561.690,169.691 L561.548,169.691 C560.695,171.076 559.132,172.178 557.072,172.178 C554.515,172.178 552.952,170.508 553.520,167.027 L554.976,158.359 L557.072,158.359 L555.651,166.885 C555.332,168.874 556.362,170.153 558.102,170.153 C559.665,170.153 561.797,168.981 562.223,166.423 L563.573,158.359 L565.669,158.359 L563.395,172.000 L561.299,172.000 ZM551.534,160.135 L548.594,160.135 L547.271,168.093 C546.987,169.869 547.839,170.153 548.763,170.153 C549.225,170.153 549.509,170.082 549.686,170.046 L549.829,171.929 C549.509,172.036 548.976,172.178 548.195,172.178 C546.418,172.178 544.713,171.041 545.104,168.661 L546.507,160.135 L544.465,160.135 L544.749,158.359 L546.800,158.359 L547.342,155.091 L549.438,155.091 L548.896,158.359 L551.818,158.359 L551.534,160.135 ZM539.780,172.000 L537.684,172.000 L538.004,170.153 L537.897,170.153 C537.329,171.041 535.873,172.320 533.493,172.320 C530.900,172.320 529.088,170.792 529.514,168.128 C530.047,165.002 532.889,164.434 535.482,164.114 C538.004,163.794 539.034,163.865 539.212,162.871 L539.212,162.800 C539.496,161.059 538.786,160.029 536.867,160.029 C534.878,160.029 533.528,161.095 532.889,162.089 L531.042,161.379 C532.498,158.892 534.985,158.182 537.045,158.182 C538.786,158.182 541.983,158.679 541.272,163.013 L539.780,172.000 ZM535.091,165.926 C533.422,166.139 531.859,166.636 531.610,168.235 C531.361,169.691 532.427,170.437 534.097,170.437 C536.583,170.437 538.217,168.767 538.501,167.062 L538.821,165.144 C538.395,165.570 535.979,165.819 535.091,165.926 ZM527.316,165.890 L517.397,165.890 C516.891,169.229 518.294,170.401 520.922,170.401 C522.601,170.401 523.915,169.691 524.688,168.270 L526.606,168.838 C525.620,170.899 523.382,172.284 520.603,172.284 C516.669,172.284 514.715,169.478 515.416,165.286 C516.100,161.095 519.049,158.182 522.734,158.182 C525.585,158.182 528.320,159.922 527.459,165.002 L527.316,165.890 ZM522.414,160.064 C520.123,160.064 518.107,162.143 517.690,164.078 L525.469,164.078 C525.869,161.770 524.697,160.064 522.414,160.064 ZM514.282,154.914 C512.897,154.914 512.222,155.624 511.973,156.974 L511.742,158.359 L514.815,158.359 L514.531,160.135 L511.449,160.135 L509.487,172.000 L507.391,172.000 L509.371,160.135 L507.178,160.135 L507.462,158.359 L509.673,158.359 L509.984,156.477 C510.339,154.132 512.435,152.960 514.389,152.960 C515.419,152.960 516.023,153.173 516.307,153.315 L515.419,155.127 C515.206,155.056 514.886,154.914 514.282,154.914 ZM493.506,172.000 L496.525,153.812 L498.621,153.812 L495.601,172.000 L493.506,172.000 ZM489.674,172.000 L487.578,172.000 L487.898,170.153 L487.791,170.153 C487.223,171.041 485.766,172.320 483.386,172.320 C480.793,172.320 478.981,170.792 479.408,168.128 C479.941,165.002 482.782,164.434 485.375,164.114 C487.898,163.794 488.928,163.865 489.105,162.871 L489.105,162.800 C489.390,161.059 488.679,160.029 486.761,160.029 C484.772,160.029 483.422,161.095 482.782,162.089 L480.935,161.379 C482.392,158.892 484.878,158.182 486.938,158.182 C488.679,158.182 491.876,158.679 491.166,163.013 L489.674,172.000 ZM484.985,165.926 C483.315,166.139 481.752,166.636 481.504,168.235 C481.255,169.691 482.321,170.437 483.990,170.437 C486.477,170.437 488.111,168.767 488.395,167.062 L488.715,165.144 C488.288,165.570 485.873,165.819 484.985,165.926 ZM475.576,172.000 L473.480,172.000 L474.901,163.475 C475.256,161.343 474.297,160.064 472.343,160.064 C470.319,160.064 468.649,161.414 468.223,163.794 L466.873,172.000 L464.777,172.000 L467.051,158.359 L469.075,158.359 L468.720,160.491 L468.898,160.491 C469.750,159.105 471.207,158.182 473.267,158.182 C476.002,158.182 477.601,159.851 477.032,163.333 L475.576,172.000 ZM455.511,172.284 C451.745,172.284 449.703,169.407 450.395,165.109 C451.070,160.917 453.948,158.182 457.571,158.182 C461.336,158.182 463.388,161.059 462.686,165.393 C462.011,169.549 459.134,172.284 455.511,172.284 ZM457.535,160.064 C454.658,160.064 452.873,162.587 452.420,165.393 C451.994,168.057 452.811,170.401 455.546,170.401 C458.423,170.401 460.208,167.924 460.661,165.109 C461.088,162.444 460.271,160.064 457.535,160.064 ZM446.401,154.630 C446.401,153.848 447.076,153.209 447.893,153.209 C448.710,153.209 449.385,153.848 449.385,154.630 C449.385,155.411 448.710,156.050 447.893,156.050 C447.076,156.050 446.401,155.411 446.401,154.630 ZM446.028,172.000 L443.932,172.000 L446.206,158.359 L448.301,158.359 L446.028,172.000 ZM442.763,160.135 L439.823,160.135 L438.500,168.093 C438.216,169.869 439.069,170.153 439.992,170.153 C440.454,170.153 440.738,170.082 440.916,170.046 L441.058,171.929 C440.738,172.036 440.205,172.178 439.424,172.178 C437.648,172.178 435.943,171.041 436.333,168.661 L437.736,160.135 L435.694,160.135 L435.978,158.359 L438.030,158.359 L438.571,155.091 L440.667,155.091 L440.125,158.359 L443.047,158.359 L442.763,160.135 ZM431.380,154.630 C431.380,153.848 432.055,153.209 432.872,153.209 C433.689,153.209 434.364,153.848 434.364,154.630 C434.364,155.411 433.689,156.050 432.872,156.050 C432.055,156.050 431.380,155.411 431.380,154.630 ZM431.007,172.000 L428.911,172.000 L431.184,158.359 L433.280,158.359 L431.007,172.000 ZM422.770,172.000 L423.126,169.904 L422.877,169.904 C422.291,170.650 421.128,172.284 418.508,172.284 C415.089,172.284 413.162,169.549 413.872,165.215 C414.591,160.917 417.424,158.182 420.870,158.182 C423.534,158.182 424.085,159.816 424.422,160.526 L424.600,160.526 L425.719,153.812 L427.815,153.812 L424.795,172.000 L422.770,172.000 ZM420.728,160.064 C418.073,160.064 416.456,162.302 415.986,165.180 C415.497,168.093 416.394,170.401 419.023,170.401 C421.545,170.401 423.357,168.270 423.872,165.180 C424.378,162.125 423.294,160.064 420.728,160.064 ZM407.216,172.000 L407.572,169.904 L407.323,169.904 C406.737,170.650 405.573,172.284 402.954,172.284 C399.535,172.284 397.608,169.549 398.318,165.215 C399.037,160.917 401.870,158.182 405.316,158.182 C407.980,158.182 408.531,159.816 408.868,160.526 L409.046,160.526 L410.165,153.812 L412.261,153.812 L409.241,172.000 L407.216,172.000 ZM405.174,160.064 C402.519,160.064 400.902,162.302 400.432,165.180 C399.943,168.093 400.840,170.401 403.469,170.401 C405.991,170.401 407.803,168.270 408.318,165.180 C408.824,162.125 407.740,160.064 405.174,160.064 ZM393.971,172.000 L391.875,172.000 L392.195,170.153 L392.088,170.153 C391.520,171.041 390.063,172.320 387.683,172.320 C385.090,172.320 383.279,170.792 383.705,168.128 C384.238,165.002 387.080,164.434 389.673,164.114 C392.195,163.794 393.225,163.865 393.403,162.871 L393.403,162.800 C393.687,161.059 392.976,160.029 391.058,160.029 C389.069,160.029 387.719,161.095 387.080,162.089 L385.232,161.379 C386.689,158.892 389.175,158.182 391.236,158.182 C392.976,158.182 396.173,158.679 395.463,163.013 L393.971,172.000 ZM389.282,165.926 C387.612,166.139 386.049,166.636 385.801,168.235 C385.552,169.691 386.618,170.437 388.287,170.437 C390.774,170.437 392.408,168.767 392.692,167.062 L393.012,165.144 C392.586,165.570 390.170,165.819 389.282,165.926 ZM372.842,172.000 L370.746,172.000 L372.167,163.475 C372.522,161.308 371.528,160.064 369.574,160.064 C367.513,160.064 365.773,161.414 365.347,163.794 L363.997,172.000 L361.901,172.000 L364.920,153.812 L367.016,153.812 L365.915,160.491 L366.093,160.491 C366.945,159.070 368.330,158.182 370.497,158.182 C373.268,158.182 374.867,159.816 374.298,163.333 L372.842,172.000 ZM360.448,160.135 L357.508,160.135 L356.185,168.093 C355.901,169.869 356.753,170.153 357.677,170.153 C358.139,170.153 358.423,170.082 358.601,170.046 L358.743,171.929 C358.423,172.036 357.890,172.178 357.109,172.178 C355.333,172.178 353.627,171.041 354.018,168.661 L355.421,160.135 L353.379,160.135 L353.663,158.359 L355.714,158.359 L356.256,155.091 L358.352,155.091 L357.810,158.359 L360.732,158.359 L360.448,160.135 ZM349.065,154.630 C349.065,153.848 349.740,153.209 350.557,153.209 C351.374,153.209 352.049,153.848 352.049,154.630 C352.049,155.411 351.374,156.050 350.557,156.050 C349.740,156.050 349.065,155.411 349.065,154.630 ZM348.692,172.000 L346.596,172.000 L348.869,158.359 L350.965,158.359 L348.692,172.000 ZM337.615,172.000 L336.372,161.521 L336.159,161.521 L331.434,172.000 L329.374,172.000 L327.491,158.359 L329.694,158.359 L330.901,168.803 L331.043,168.803 L335.697,158.359 L337.935,158.359 L339.072,168.767 L339.214,168.767 L343.903,158.359 L346.105,158.359 L339.675,172.000 L337.615,172.000 ZM316.983,172.000 L314.319,172.000 L310.296,165.526 L308.600,166.885 L307.747,172.000 L305.651,172.000 L308.671,153.812 L310.767,153.812 L308.999,164.434 L309.239,164.434 L316.237,158.359 L318.830,158.359 L312.090,164.203 L316.983,172.000 ZM303.559,160.171 C301.569,160.171 299.882,161.530 299.580,163.368 L298.159,172.000 L296.063,172.000 L298.337,158.359 L300.362,158.359 L300.006,160.420 L300.149,160.420 C300.859,159.070 302.422,158.146 304.091,158.146 C304.837,158.146 305.370,158.324 305.726,158.644 L304.731,160.384 C304.482,160.242 304.091,160.171 303.559,160.171 ZM286.797,172.284 C283.031,172.284 280.989,169.407 281.682,165.109 C282.356,160.917 285.234,158.182 288.857,158.182 C292.622,158.182 294.674,161.059 293.972,165.393 C293.297,169.549 290.420,172.284 286.797,172.284 ZM288.822,160.064 C285.944,160.064 284.159,162.587 283.706,165.393 C283.280,168.057 284.097,170.401 286.832,170.401 C289.710,170.401 291.495,167.924 291.948,165.109 C292.374,162.444 291.557,160.064 288.822,160.064 ZM280.512,154.914 C279.126,154.914 278.452,155.624 278.203,156.974 L277.972,158.359 L281.045,158.359 L280.760,160.135 L277.679,160.135 L275.716,172.000 L273.620,172.000 L275.601,160.135 L273.407,160.135 L273.691,158.359 L275.903,158.359 L276.214,156.477 C276.569,154.132 278.665,152.960 280.618,152.960 C281.649,152.960 282.252,153.173 282.537,153.315 L281.649,155.127 C281.435,155.056 281.116,154.914 280.512,154.914 ZM259.735,172.000 L262.755,153.812 L264.851,153.812 L261.831,172.000 L259.735,172.000 ZM253.595,172.000 L253.950,169.904 L253.701,169.904 C253.115,170.650 251.952,172.284 249.332,172.284 C245.913,172.284 243.986,169.549 244.696,165.215 C245.416,160.917 248.249,158.182 251.694,158.182 C254.358,158.182 254.909,159.816 255.246,160.526 L255.424,160.526 L256.543,153.812 L258.639,153.812 L255.619,172.000 L253.595,172.000 ZM251.552,160.064 C248.897,160.064 247.281,162.302 246.810,165.180 C246.321,168.093 247.218,170.401 249.847,170.401 C252.369,170.401 254.181,168.270 254.696,165.180 C255.202,162.125 254.119,160.064 251.552,160.064 ZM233.670,165.180 L233.990,163.226 L241.947,163.226 L241.627,165.180 L233.670,165.180 ZM230.478,165.890 L220.558,165.890 C220.052,169.229 221.455,170.401 224.084,170.401 C225.762,170.401 227.077,169.691 227.849,168.270 L229.768,168.838 C228.782,170.899 226.544,172.284 223.764,172.284 C219.830,172.284 217.876,169.478 218.578,165.286 C219.262,161.095 222.210,158.182 225.896,158.182 C228.746,158.182 231.482,159.922 230.620,165.002 L230.478,165.890 ZM225.576,160.064 C223.285,160.064 221.269,162.143 220.851,164.078 L228.631,164.078 C229.030,161.770 227.858,160.064 225.576,160.064 ZM209.063,172.284 C206.434,172.284 205.830,170.650 205.475,169.904 L205.226,169.904 L204.871,172.000 L202.846,172.000 L205.866,153.812 L207.962,153.812 L206.860,160.526 L207.038,160.526 C207.606,159.816 208.708,158.182 211.372,158.182 C214.817,158.182 216.736,160.917 216.025,165.215 C215.315,169.549 212.473,172.284 209.063,172.284 ZM210.803,160.064 C208.246,160.064 206.541,162.125 206.043,165.180 C205.546,168.270 206.576,170.401 209.098,170.401 C211.727,170.401 213.432,168.093 213.929,165.180 C214.391,162.302 213.468,160.064 210.803,160.064 ZM196.634,172.000 L197.025,169.691 L196.883,169.691 C196.031,171.076 194.468,172.178 192.407,172.178 C189.850,172.178 188.287,170.508 188.855,167.027 L190.311,158.359 L192.407,158.359 L190.986,166.885 C190.667,168.874 191.697,170.153 193.437,170.153 C195.000,170.153 197.132,168.981 197.558,166.423 L198.908,158.359 L201.004,158.359 L198.730,172.000 L196.634,172.000 ZM186.869,160.135 L183.929,160.135 L182.606,168.093 C182.322,169.869 183.174,170.153 184.098,170.153 C184.560,170.153 184.844,170.082 185.022,170.046 L185.164,171.929 C184.844,172.036 184.311,172.178 183.530,172.178 C181.754,172.178 180.048,171.041 180.439,168.661 L181.842,160.135 L179.800,160.135 L180.084,158.359 L182.135,158.359 L182.677,155.091 L184.773,155.091 L184.231,158.359 L187.153,158.359 L186.869,160.135 ZM173.020,172.000 L173.410,169.691 L173.268,169.691 C172.416,171.076 170.853,172.178 168.792,172.178 C166.235,172.178 164.672,170.508 165.240,167.027 L166.697,158.359 L168.792,158.359 L167.372,166.885 C167.052,168.874 168.082,170.153 169.823,170.153 C171.386,170.153 173.517,168.981 173.943,166.423 L175.293,158.359 L177.389,158.359 L175.115,172.000 L173.020,172.000 ZM155.157,172.284 C151.391,172.284 149.349,169.407 150.041,165.109 C150.716,160.917 153.594,158.182 157.217,158.182 C160.982,158.182 163.034,161.059 162.332,165.393 C161.657,169.549 158.780,172.284 155.157,172.284 ZM157.181,160.064 C154.304,160.064 152.519,162.587 152.066,165.393 C151.640,168.057 152.457,170.401 155.192,170.401 C158.069,170.401 159.854,167.924 160.307,165.109 C160.734,162.444 159.917,160.064 157.181,160.064 ZM136.511,177.293 C135.801,177.293 135.197,177.151 135.019,177.044 L135.836,175.197 C137.293,175.588 138.207,175.366 139.317,173.350 L140.063,172.000 L137.293,158.359 L139.495,158.359 L141.449,169.229 L141.591,169.229 L147.168,158.359 L149.512,158.359 L141.023,174.202 C139.886,176.298 138.429,177.293 136.511,177.293 ZM123.225,166.849 L115.871,166.849 L113.181,172.000 L110.872,172.000 L120.569,153.812 L122.843,153.812 L126.501,172.000 L124.192,172.000 L123.225,166.849 ZM121.315,156.690 L121.173,156.690 L116.893,164.895 L122.860,164.895 L121.315,156.690 Z" class="cls-2"/> - <path d="M252.245,116.350 L252.245,102.200 L309.303,102.200 L309.303,116.350 L252.245,116.350 ZM208.254,81.088 L245.342,59.291 L208.254,38.180 L216.242,25.227 L260.862,52.844 L260.862,65.739 L216.413,93.355 L208.254,81.088 Z" class="cls-3"/> - <path d="M508.108,52.635 C507.921,55.093 507.643,57.527 507.274,59.937 L504.214,78.017 C503.658,81.170 502.754,84.324 501.502,87.475 C500.250,90.628 498.464,93.479 496.147,96.028 C493.829,98.579 491.047,100.503 487.802,101.800 C484.556,103.097 481.311,103.747 478.067,103.747 C476.211,103.747 474.357,103.491 472.504,102.982 C470.648,102.474 469.072,101.615 467.775,100.409 C466.475,99.205 465.410,97.767 464.576,96.098 C463.741,94.429 463.092,92.714 462.629,90.952 L455.953,131.146 L436.482,131.146 L453.310,28.922 L472.921,28.922 L471.391,38.240 C472.504,36.665 473.777,35.180 475.216,33.790 C476.652,32.399 478.228,31.240 479.944,30.313 C481.659,29.387 483.467,28.737 485.369,28.365 C487.268,27.996 489.145,27.809 491.001,27.809 C493.411,27.809 495.706,28.226 497.886,29.061 C500.063,29.895 501.871,31.171 503.310,32.886 C504.746,34.602 505.835,36.549 506.578,38.727 C507.319,40.907 507.806,43.156 508.039,45.472 C508.269,47.791 508.293,50.179 508.108,52.635 ZM487.455,48.184 C486.851,46.841 485.877,45.798 484.534,45.055 C483.189,44.314 481.729,43.942 480.153,43.942 C478.762,43.942 477.393,44.151 476.050,44.568 C474.705,44.986 473.499,45.681 472.434,46.655 C471.367,47.628 470.556,48.765 470.000,50.062 C469.444,51.362 469.027,52.659 468.748,53.956 L465.828,72.037 C465.641,73.149 465.480,74.286 465.341,75.444 C465.202,76.605 465.178,77.717 465.271,78.782 C465.363,79.849 465.526,80.916 465.758,81.981 C465.988,83.048 466.384,84.022 466.940,84.902 C467.497,85.784 468.283,86.456 469.305,86.918 C470.324,87.383 471.391,87.614 472.504,87.614 C474.079,87.614 475.633,87.314 477.163,86.710 C478.693,86.108 480.036,85.204 481.196,83.998 C482.354,82.794 483.235,81.425 483.839,79.895 C484.441,78.365 484.882,76.859 485.160,75.375 L488.081,57.294 C488.359,55.719 488.474,54.143 488.428,52.565 C488.381,50.990 488.057,49.530 487.455,48.184 ZM433.422,86.501 L433.422,102.635 L384.744,102.635 L384.744,86.501 L401.433,86.501 L412.977,16.544 L400.460,16.544 L400.460,0.410 L435.230,0.410 L420.905,86.501 L433.422,86.501 ZM354.285,102.635 L355.815,93.177 C354.793,94.846 353.542,96.354 352.060,97.697 C350.575,99.042 348.976,100.179 347.261,101.105 C345.545,102.033 343.736,102.704 341.837,103.121 C339.936,103.539 338.058,103.747 336.204,103.747 C333.792,103.747 331.497,103.330 329.320,102.495 C327.140,101.661 325.332,100.388 323.896,98.671 C322.457,96.956 321.368,94.985 320.627,92.760 C319.884,90.535 319.397,88.264 319.167,85.945 C318.934,83.628 318.911,81.264 319.097,78.852 C319.282,76.442 319.606,74.032 320.071,71.620 L322.992,53.539 C323.548,50.295 324.452,47.096 325.704,43.942 C326.955,40.791 328.764,37.962 331.128,35.459 C333.492,32.955 336.274,31.056 339.473,29.756 C342.672,28.459 345.892,27.809 349.139,27.809 C351.086,27.809 352.964,28.066 354.772,28.574 C356.580,29.085 358.155,29.943 359.500,31.147 C360.843,32.353 361.934,33.790 362.769,35.459 C363.603,37.128 364.205,38.844 364.577,40.605 L371.253,0.410 L390.724,0.410 L373.895,102.635 L354.285,102.635 ZM362.004,52.705 C361.956,51.592 361.795,50.503 361.517,49.436 C361.239,48.371 360.822,47.419 360.265,46.585 C359.709,45.751 358.920,45.103 357.901,44.638 C356.880,44.175 355.815,43.942 354.702,43.942 C353.124,43.942 351.573,44.245 350.043,44.846 C348.513,45.451 347.168,46.355 346.010,47.559 C344.849,48.765 343.969,50.110 343.367,51.592 C342.763,53.076 342.370,54.606 342.185,56.182 L339.125,74.262 C338.847,75.840 338.730,77.415 338.777,78.991 C338.823,80.569 339.147,82.029 339.751,83.372 C340.353,84.717 341.326,85.760 342.672,86.501 C344.015,87.244 345.475,87.614 347.053,87.614 C348.443,87.614 349.810,87.405 351.156,86.988 C352.499,86.571 353.705,85.875 354.772,84.902 C355.836,83.928 356.671,82.794 357.275,81.494 C357.877,80.197 358.270,78.900 358.457,77.600 L361.517,59.520 C361.702,58.407 361.841,57.272 361.934,56.112 C362.026,54.954 362.049,53.817 362.004,52.705 Z" class="cls-4"/> -</svg> diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index ac0cfdf7c..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,428 +0,0 @@ -name: Build Artifacts -on: - workflow_call: - inputs: - version: - required: true - type: string - channel: - required: false - default: stable - type: string - unix: - default: true - type: boolean - linux_arm: - default: true - type: boolean - macos: - default: true - type: boolean - macos_legacy: - default: true - type: boolean - windows: - default: true - type: boolean - windows32: - default: true - type: boolean - meta_files: - default: true - type: boolean - secrets: - GPG_SIGNING_KEY: - required: false - - workflow_dispatch: - inputs: - version: - description: Version tag (YYYY.MM.DD[.REV]) - required: true - type: string - channel: - description: Update channel (stable/nightly/...) - required: true - default: stable - type: string - unix: - description: yt-dlp, yt-dlp.tar.gz, yt-dlp_linux, yt-dlp_linux.zip - default: true - type: boolean - linux_arm: - description: yt-dlp_linux_aarch64, yt-dlp_linux_armv7l - default: true - type: boolean - macos: - description: yt-dlp_macos, yt-dlp_macos.zip - default: true - type: boolean - macos_legacy: - description: yt-dlp_macos_legacy - default: true - type: boolean - windows: - description: yt-dlp.exe, yt-dlp_min.exe, yt-dlp_win.zip - default: true - type: boolean - windows32: - description: yt-dlp_x86.exe - default: true - type: boolean - meta_files: - description: SHA2-256SUMS, SHA2-512SUMS, _update_spec - default: true - type: boolean - -permissions: - contents: read - -jobs: - unix: - if: inputs.unix - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - uses: conda-incubator/setup-miniconda@v2 - with: - miniforge-variant: Mambaforge - use-mamba: true - channels: conda-forge - auto-update-conda: true - activate-environment: "" - auto-activate-base: false - - name: Install Requirements - run: | - sudo apt-get -y install zip pandoc man sed - python -m pip install -U pip setuptools wheel - python -m pip install -U Pyinstaller -r requirements.txt - reqs=$(mktemp) - cat > $reqs << EOF - python=3.10.* - pyinstaller - cffi - brotli-python - EOF - sed '/^brotli.*/d' requirements.txt >> $reqs - mamba create -n build --file $reqs - - - name: Prepare - run: | - python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }} - python devscripts/make_lazy_extractors.py - - name: Build Unix platform-independent binary - run: | - make all tar - - name: Build Unix standalone binary - shell: bash -l {0} - run: | - unset LD_LIBRARY_PATH # Harmful; set by setup-python - conda activate build - python pyinst.py --onedir - (cd ./dist/yt-dlp_linux && zip -r ../yt-dlp_linux.zip .) - python pyinst.py - mv ./dist/yt-dlp_linux ./yt-dlp_linux - mv ./dist/yt-dlp_linux.zip ./yt-dlp_linux.zip - - - name: Verify --update-to - if: vars.UPDATE_TO_VERIFICATION - run: | - binaries=("yt-dlp" "yt-dlp_linux") - for binary in "${binaries[@]}"; do - chmod +x ./${binary} - cp ./${binary} ./${binary}_downgraded - version="$(./${binary} --version)" - ./${binary}_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04 - downgraded_version="$(./${binary}_downgraded --version)" - [[ "$version" != "$downgraded_version" ]] - done - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - path: | - yt-dlp - yt-dlp.tar.gz - yt-dlp_linux - yt-dlp_linux.zip - - linux_arm: - if: inputs.linux_arm - permissions: - contents: read - packages: write # for creating cache - runs-on: ubuntu-latest - strategy: - matrix: - architecture: - - armv7 - - aarch64 - - steps: - - uses: actions/checkout@v3 - with: - path: ./repo - - name: Virtualized Install, Prepare & Build - uses: yt-dlp/run-on-arch-action@v2 - with: - # Ref: https://github.com/uraimo/run-on-arch-action/issues/55 - env: | - GITHUB_WORKFLOW: build - githubToken: ${{ github.token }} # To cache image - arch: ${{ matrix.architecture }} - distro: ubuntu18.04 # Standalone executable should be built on minimum supported OS - dockerRunArgs: --volume "${PWD}/repo:/repo" - install: | # Installing Python 3.10 from the Deadsnakes repo raises errors - apt update - apt -y install zlib1g-dev python3.8 python3.8-dev python3.8-distutils python3-pip - python3.8 -m pip install -U pip setuptools wheel - # Cannot access requirements.txt from the repo directory at this stage - python3.8 -m pip install -U Pyinstaller mutagen pycryptodomex websockets brotli certifi - - run: | - cd repo - python3.8 -m pip install -U Pyinstaller -r requirements.txt # Cached version may be out of date - python3.8 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }} - python3.8 devscripts/make_lazy_extractors.py - python3.8 pyinst.py - - if ${{ vars.UPDATE_TO_VERIFICATION && 'true' || 'false' }}; then - arch="${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }}" - chmod +x ./dist/yt-dlp_linux_${arch} - cp ./dist/yt-dlp_linux_${arch} ./dist/yt-dlp_linux_${arch}_downgraded - version="$(./dist/yt-dlp_linux_${arch} --version)" - ./dist/yt-dlp_linux_${arch}_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04 - downgraded_version="$(./dist/yt-dlp_linux_${arch}_downgraded --version)" - [[ "$version" != "$downgraded_version" ]] - fi - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - path: | # run-on-arch-action designates armv7l as armv7 - repo/dist/yt-dlp_linux_${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }} - - macos: - if: inputs.macos - runs-on: macos-11 - - steps: - - uses: actions/checkout@v3 - # NB: Building universal2 does not work with python from actions/setup-python - - name: Install Requirements - run: | - brew install coreutils - python3 -m pip install -U --user pip setuptools wheel - # We need to ignore wheels otherwise we break universal2 builds - python3 -m pip install -U --user --no-binary :all: Pyinstaller -r requirements.txt - - - name: Prepare - run: | - python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }} - python3 devscripts/make_lazy_extractors.py - - name: Build - run: | - python3 pyinst.py --target-architecture universal2 --onedir - (cd ./dist/yt-dlp_macos && zip -r ../yt-dlp_macos.zip .) - python3 pyinst.py --target-architecture universal2 - - - name: Verify --update-to - if: vars.UPDATE_TO_VERIFICATION - run: | - chmod +x ./dist/yt-dlp_macos - cp ./dist/yt-dlp_macos ./dist/yt-dlp_macos_downgraded - version="$(./dist/yt-dlp_macos --version)" - ./dist/yt-dlp_macos_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04 - downgraded_version="$(./dist/yt-dlp_macos_downgraded --version)" - [[ "$version" != "$downgraded_version" ]] - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - path: | - dist/yt-dlp_macos - dist/yt-dlp_macos.zip - - macos_legacy: - if: inputs.macos_legacy - runs-on: macos-latest - - steps: - - uses: actions/checkout@v3 - - name: Install Python - # We need the official Python, because the GA ones only support newer macOS versions - env: - PYTHON_VERSION: 3.10.5 - MACOSX_DEPLOYMENT_TARGET: 10.9 # Used up by the Python build tools - run: | - # Hack to get the latest patch version. Uncomment if needed - #brew install python@3.10 - #export PYTHON_VERSION=$( $(brew --prefix)/opt/python@3.10/bin/python3 --version | cut -d ' ' -f 2 ) - curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o "python.pkg" - sudo installer -pkg python.pkg -target / - python3 --version - - name: Install Requirements - run: | - brew install coreutils - python3 -m pip install -U --user pip setuptools wheel - python3 -m pip install -U --user Pyinstaller -r requirements.txt - - - name: Prepare - run: | - python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }} - python3 devscripts/make_lazy_extractors.py - - name: Build - run: | - python3 pyinst.py - mv dist/yt-dlp_macos dist/yt-dlp_macos_legacy - - - name: Verify --update-to - if: vars.UPDATE_TO_VERIFICATION - run: | - chmod +x ./dist/yt-dlp_macos_legacy - cp ./dist/yt-dlp_macos_legacy ./dist/yt-dlp_macos_legacy_downgraded - version="$(./dist/yt-dlp_macos_legacy --version)" - ./dist/yt-dlp_macos_legacy_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04 - downgraded_version="$(./dist/yt-dlp_macos_legacy_downgraded --version)" - [[ "$version" != "$downgraded_version" ]] - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - path: | - dist/yt-dlp_macos_legacy - - windows: - if: inputs.windows - runs-on: windows-latest - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: # 3.8 is used for Win7 support - python-version: "3.8" - - name: Install Requirements - run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds - python -m pip install -U pip setuptools wheel py2exe - pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-5.8.0-py3-none-any.whl" -r requirements.txt - - - name: Prepare - run: | - python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }} - python devscripts/make_lazy_extractors.py - - name: Build - run: | - python setup.py py2exe - Move-Item ./dist/yt-dlp.exe ./dist/yt-dlp_min.exe - python pyinst.py - python pyinst.py --onedir - Compress-Archive -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win.zip - - - name: Verify --update-to - if: vars.UPDATE_TO_VERIFICATION - run: | - foreach ($name in @("yt-dlp","yt-dlp_min")) { - Copy-Item "./dist/${name}.exe" "./dist/${name}_downgraded.exe" - $version = & "./dist/${name}.exe" --version - & "./dist/${name}_downgraded.exe" -v --update-to yt-dlp/yt-dlp@2023.03.04 - $downgraded_version = & "./dist/${name}_downgraded.exe" --version - if ($version -eq $downgraded_version) { - exit 1 - } - } - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - path: | - dist/yt-dlp.exe - dist/yt-dlp_min.exe - dist/yt-dlp_win.zip - - windows32: - if: inputs.windows32 - runs-on: windows-latest - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: # 3.7 is used for Vista support. See https://github.com/yt-dlp/yt-dlp/issues/390 - python-version: "3.7" - architecture: "x86" - - name: Install Requirements - run: | - python -m pip install -U pip setuptools wheel - pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-5.8.0-py3-none-any.whl" -r requirements.txt - - - name: Prepare - run: | - python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }} - python devscripts/make_lazy_extractors.py - - name: Build - run: | - python pyinst.py - - - name: Verify --update-to - if: vars.UPDATE_TO_VERIFICATION - run: | - foreach ($name in @("yt-dlp_x86")) { - Copy-Item "./dist/${name}.exe" "./dist/${name}_downgraded.exe" - $version = & "./dist/${name}.exe" --version - & "./dist/${name}_downgraded.exe" -v --update-to yt-dlp/yt-dlp@2023.03.04 - $downgraded_version = & "./dist/${name}_downgraded.exe" --version - if ($version -eq $downgraded_version) { - exit 1 - } - } - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - path: | - dist/yt-dlp_x86.exe - - meta_files: - if: inputs.meta_files && always() && !cancelled() - needs: - - unix - - linux_arm - - macos - - macos_legacy - - windows - - windows32 - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v3 - - - name: Make SHA2-SUMS files - run: | - cd ./artifact/ - sha256sum * > ../SHA2-256SUMS - sha512sum * > ../SHA2-512SUMS - - - name: Make Update spec - run: | - cat >> _update_spec << EOF - # This file is used for regulating self-update - lock 2022.08.18.36 .+ Python 3.6 - EOF - - - name: Sign checksum files - env: - GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} - if: env.GPG_SIGNING_KEY != '' - run: | - gpg --batch --import <<< "${{ secrets.GPG_SIGNING_KEY }}" - for signfile in ./SHA*SUMS; do - gpg --batch --detach-sign "$signfile" - done - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - path: | - SHA*SUMS* - _update_spec diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 2821d90d0..000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [ 'master', 'gh-pages', 'release' ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ 'master' ] - schedule: - - cron: '59 11 * * 5' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml deleted file mode 100644 index dead444c0..000000000 --- a/.github/workflows/core.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Core Tests -on: [push, pull_request] -permissions: - contents: read - -jobs: - tests: - name: Core Tests - if: "!contains(github.event.head_commit.message, 'ci skip')" - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - # CPython 3.11 is in quick-test - python-version: ['3.8', '3.9', '3.10', pypy-3.7, pypy-3.8] - run-tests-ext: [sh] - include: - # atleast one of each CPython/PyPy tests must be in windows - - os: windows-latest - python-version: '3.7' - run-tests-ext: bat - - os: windows-latest - python-version: pypy-3.9 - run-tests-ext: bat - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install pytest - run: pip install pytest - - name: Run tests - continue-on-error: False - run: | - python3 -m yt_dlp -v || true # Print debug head - ./devscripts/run_tests.${{ matrix.run-tests-ext }} core diff --git a/.github/workflows/download.yml b/.github/workflows/download.yml deleted file mode 100644 index 2b2387d4f..000000000 --- a/.github/workflows/download.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Download Tests -on: [push, pull_request] -permissions: - contents: read - -jobs: - quick: - name: Quick Download Tests - if: "contains(github.event.head_commit.message, 'ci run dl')" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Install test requirements - run: pip install pytest - - name: Run tests - continue-on-error: true - run: ./devscripts/run_tests.sh download - - full: - name: Full Download Tests - if: "contains(github.event.head_commit.message, 'ci run dl all')" - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - python-version: ['3.7', '3.10', 3.11-dev, pypy-3.7, pypy-3.8] - run-tests-ext: [sh] - include: - # atleast one of each CPython/PyPy tests must be in windows - - os: windows-latest - python-version: '3.8' - run-tests-ext: bat - - os: windows-latest - python-version: pypy-3.9 - run-tests-ext: bat - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install pytest - run: pip install pytest - - name: Run tests - continue-on-error: true - run: ./devscripts/run_tests.${{ matrix.run-tests-ext }} download diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 9ebf54e7f..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Publish -on: - workflow_call: - inputs: - channel: - default: stable - required: true - type: string - version: - required: true - type: string - target_commitish: - required: true - type: string - prerelease: - default: false - required: true - type: boolean - secrets: - ARCHIVE_REPO_TOKEN: - required: false - -permissions: - contents: write - -jobs: - publish: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/download-artifact@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Generate release notes - run: | - printf '%s' \ - '[]' \ - '(https://github.com/yt-dlp/yt-dlp#installation "Installation instructions") ' \ - '[]' \ - '(https://github.com/yt-dlp/yt-dlp/tree/2023.03.04#readme "Documentation") ' \ - '[]' \ - '(https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators "Donate") ' \ - '[]' \ - '(https://discord.gg/H5MNcFW63r "Discord") ' \ - ${{ inputs.channel != 'nightly' && '"[]" \ - "(https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest \"Nightly builds\")"' || '' }} \ - > ./RELEASE_NOTES - printf '\n\n' >> ./RELEASE_NOTES - cat >> ./RELEASE_NOTES << EOF - #### A description of the various files are in the [README](https://github.com/yt-dlp/yt-dlp#release-files) - --- - $(python ./devscripts/make_changelog.py -vv --collapsible) - EOF - printf '%s\n\n' '**This is an automated nightly pre-release build**' >> ./NIGHTLY_NOTES - cat ./RELEASE_NOTES >> ./NIGHTLY_NOTES - printf '%s\n\n' 'Generated from: https://github.com/${{ github.repository }}/commit/${{ inputs.target_commitish }}' >> ./ARCHIVE_NOTES - cat ./RELEASE_NOTES >> ./ARCHIVE_NOTES - - - name: Archive nightly release - env: - GH_TOKEN: ${{ secrets.ARCHIVE_REPO_TOKEN }} - GH_REPO: ${{ vars.ARCHIVE_REPO }} - if: | - inputs.channel == 'nightly' && env.GH_TOKEN != '' && env.GH_REPO != '' - run: | - gh release create \ - --notes-file ARCHIVE_NOTES \ - --title "yt-dlp nightly ${{ inputs.version }}" \ - ${{ inputs.version }} \ - artifact/* - - - name: Prune old nightly release - if: inputs.channel == 'nightly' && !vars.ARCHIVE_REPO - env: - GH_TOKEN: ${{ github.token }} - run: | - gh release delete --yes --cleanup-tag "nightly" || true - git tag --delete "nightly" || true - sleep 5 # Enough time to cover deletion race condition - - - name: Publish release${{ inputs.channel == 'nightly' && ' (nightly)' || '' }} - env: - GH_TOKEN: ${{ github.token }} - if: (inputs.channel == 'nightly' && !vars.ARCHIVE_REPO) || inputs.channel != 'nightly' - run: | - gh release create \ - --notes-file ${{ inputs.channel == 'nightly' && 'NIGHTLY_NOTES' || 'RELEASE_NOTES' }} \ - --target ${{ inputs.target_commitish }} \ - --title "yt-dlp ${{ inputs.channel == 'nightly' && 'nightly ' || '' }}${{ inputs.version }}" \ - ${{ inputs.prerelease && '--prerelease' || '' }} \ - ${{ inputs.channel == 'nightly' && '"nightly"' || inputs.version }} \ - artifact/* diff --git a/.github/workflows/quick-test.yml b/.github/workflows/quick-test.yml deleted file mode 100644 index 930e58152..000000000 --- a/.github/workflows/quick-test.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Quick Test -on: [push, pull_request] -permissions: - contents: read - -jobs: - tests: - name: Core Test - if: "!contains(github.event.head_commit.message, 'ci skip all')" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - name: Install test requirements - run: pip install pytest pycryptodomex - - name: Run tests - run: | - python3 -m yt_dlp -v || true - ./devscripts/run_tests.sh core - flake8: - name: Linter - if: "!contains(github.event.head_commit.message, 'ci skip all')" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - - name: Install flake8 - run: pip install flake8 - - name: Make lazy extractors - run: python devscripts/make_lazy_extractors.py - - name: Run flake8 - run: flake8 . diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml deleted file mode 100644 index 543e2e6f7..000000000 --- a/.github/workflows/release-nightly.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Release (nightly) -on: - push: - branches: - - master - paths: - - "yt_dlp/**.py" - - "!yt_dlp/version.py" -concurrency: - group: release-nightly - cancel-in-progress: true -permissions: - contents: read - -jobs: - prepare: - if: vars.BUILD_NIGHTLY != '' - runs-on: ubuntu-latest - outputs: - version: ${{ steps.get_version.outputs.version }} - - steps: - - uses: actions/checkout@v3 - - name: Get version - id: get_version - run: | - python devscripts/update-version.py "$(date -u +"%H%M%S")" | grep -Po "version=\d+(\.\d+){3}" >> "$GITHUB_OUTPUT" - - build: - needs: prepare - uses: ./.github/workflows/build.yml - with: - version: ${{ needs.prepare.outputs.version }} - channel: nightly - permissions: - contents: read - packages: write # For package cache - secrets: - GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} - - publish: - needs: [prepare, build] - uses: ./.github/workflows/publish.yml - secrets: - ARCHIVE_REPO_TOKEN: ${{ secrets.ARCHIVE_REPO_TOKEN }} - permissions: - contents: write - with: - channel: nightly - prerelease: true - version: ${{ needs.prepare.outputs.version }} - target_commitish: ${{ github.sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index ada508be8..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: Release -on: - workflow_dispatch: - inputs: - version: - description: Version tag (YYYY.MM.DD[.REV]) - required: false - default: '' - type: string - channel: - description: Update channel (stable/nightly/...) - required: false - default: '' - type: string - prerelease: - description: Pre-release - default: false - type: boolean - -permissions: - contents: read - -jobs: - prepare: - permissions: - contents: write - runs-on: ubuntu-latest - outputs: - channel: ${{ steps.set_channel.outputs.channel }} - version: ${{ steps.update_version.outputs.version }} - head_sha: ${{ steps.get_target.outputs.head_sha }} - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Set channel - id: set_channel - run: | - CHANNEL="${{ github.repository == 'yt-dlp/yt-dlp' && 'stable' || github.repository }}" - echo "channel=${{ inputs.channel || '$CHANNEL' }}" > "$GITHUB_OUTPUT" - - - name: Update version - id: update_version - run: | - REVISION="${{ vars.PUSH_VERSION_COMMIT == '' && '$(date -u +"%H%M%S")' || '' }}" - REVISION="${{ inputs.prerelease && '$(date -u +"%H%M%S")' || '$REVISION' }}" - python devscripts/update-version.py ${{ inputs.version || '$REVISION' }} | \ - grep -Po "version=\d+\.\d+\.\d+(\.\d+)?" >> "$GITHUB_OUTPUT" - - - name: Update documentation - run: | - make doc - sed '/### /Q' Changelog.md >> ./CHANGELOG - echo '### ${{ steps.update_version.outputs.version }}' >> ./CHANGELOG - python ./devscripts/make_changelog.py -vv -c >> ./CHANGELOG - echo >> ./CHANGELOG - grep -Poz '(?s)### \d+\.\d+\.\d+.+' 'Changelog.md' | head -n -1 >> ./CHANGELOG - cat ./CHANGELOG > Changelog.md - - - name: Push to release - id: push_release - if: ${{ !inputs.prerelease }} - run: | - git config --global user.name github-actions - git config --global user.email github-actions@example.com - git add -u - git commit -m "Release ${{ steps.update_version.outputs.version }}" \ - -m "Created by: ${{ github.event.sender.login }}" -m ":ci skip all :ci run dl" - git push origin --force ${{ github.event.ref }}:release - - - name: Get target commitish - id: get_target - run: | - echo "head_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - - - name: Update master - if: vars.PUSH_VERSION_COMMIT != '' && !inputs.prerelease - run: git push origin ${{ github.event.ref }} - - build: - needs: prepare - uses: ./.github/workflows/build.yml - with: - version: ${{ needs.prepare.outputs.version }} - channel: ${{ needs.prepare.outputs.channel }} - permissions: - contents: read - packages: write # For package cache - secrets: - GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} - - publish_pypi_homebrew: - needs: [prepare, build] - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Install Requirements - run: | - sudo apt-get -y install pandoc man - python -m pip install -U pip setuptools wheel twine - python -m pip install -U -r requirements.txt - - - name: Prepare - run: | - python devscripts/update-version.py ${{ needs.prepare.outputs.version }} - python devscripts/make_lazy_extractors.py - - - name: Build and publish on PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - if: env.TWINE_PASSWORD != '' && !inputs.prerelease - run: | - rm -rf dist/* - make pypi-files - python devscripts/set-variant.py pip -M "You installed yt-dlp with pip or using the wheel from PyPi; Use that to update" - python setup.py sdist bdist_wheel - twine upload dist/* - - - name: Checkout Homebrew repository - env: - BREW_TOKEN: ${{ secrets.BREW_TOKEN }} - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - if: env.BREW_TOKEN != '' && env.PYPI_TOKEN != '' && !inputs.prerelease - uses: actions/checkout@v3 - with: - repository: yt-dlp/homebrew-taps - path: taps - ssh-key: ${{ secrets.BREW_TOKEN }} - - - name: Update Homebrew Formulae - env: - BREW_TOKEN: ${{ secrets.BREW_TOKEN }} - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - if: env.BREW_TOKEN != '' && env.PYPI_TOKEN != '' && !inputs.prerelease - run: | - python devscripts/update-formulae.py taps/Formula/yt-dlp.rb "${{ needs.prepare.outputs.version }}" - git -C taps/ config user.name github-actions - git -C taps/ config user.email github-actions@example.com - git -C taps/ commit -am 'yt-dlp: ${{ needs.prepare.outputs.version }}' - git -C taps/ push - - publish: - needs: [prepare, build] - uses: ./.github/workflows/publish.yml - permissions: - contents: write - with: - channel: ${{ needs.prepare.outputs.channel }} - prerelease: ${{ inputs.prerelease }} - version: ${{ needs.prepare.outputs.version }} - target_commitish: ${{ needs.prepare.outputs.head_sha }} diff --git a/.gitignore b/.gitignore index 507ba8c7f..561edc921 100644 --- a/.gitignore +++ b/.gitignore @@ -14,10 +14,7 @@ cookies *.frag.urls *.info.json *.live_chat.json -*.meta *.part* -*.tmp -*.temp *.unknown_video *.ytdl .cache/ @@ -74,7 +71,6 @@ tmp/ venv/ .venv/ completions/ - # Misc *~ *.DS_Store @@ -94,32 +90,123 @@ updates_key.pem # Generated AUTHORS README.txt +README.md +CONTRIBUTING.md .mailmap *.1 *.bash-completion *.fish *.tar.gz *.zsh -*.spec -test/testdata/sigs/player-*.js - +test/testdata/player-*.js # Binary -/youtube-dl -/youtube-dlc -/yt-dlp +/ytdlp yt-dlp.zip -*.exe - # Text Editor / IDE .idea *.iml .vscode *.sublime-* *.code-workspace - # Lazy extractors */extractor/lazy_extractors.py - # Plugins +ytdlp_plugins/extractor/* +!ytdlp_plugins/extractor/__init__.py +!ytdlp_plugins/extractor/sample.py +# VS Code related files +# branding +.readthedocs.yml +hypervideo.1 +hypervideo.bash-completion +hypervideo.fish +hypervideo +hypervideo.exe +hypervideo.tar.gz +setup.py +tox.in +# Ignore nonfree JS or SWF bytecode +.github/ISSUE_TEMPLATE/1_broken_site.md +.github/ISSUE_TEMPLATE/2_site_support_request.md +.github/ISSUE_TEMPLATE/3_site_feature_request.md +.github/ISSUE_TEMPLATE/4_bug_report.md +.github/ISSUE_TEMPLATE/5_feature_request.md +.github/ISSUE_TEMPLATE/6_question.md +.github/ISSUE_TEMPLATE_tmpl/1_broken_site.md +.github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md +.github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md +.github/ISSUE_TEMPLATE_tmpl/4_bug_report.md +.github/ISSUE_TEMPLATE_tmpl/5_feature_request.md +.github/PULL_REQUEST_TEMPLATE.md +.github/ISSUE_TEMPLATE.md +.github/ISSUE_TEMPLATE_tmpl.md +.github/FUNDING.yml +.github/banner.svg +.github/workflows/build.yml +.github/workflows/core.yml +.github/workflows/download.yml +.github/workflows/quick-test.yml +devscripts/create-github-release.py +devscripts/gh-pages.unused/add-version.py +devscripts/gh-pages.unused/generate-download.py +devscripts/gh-pages.unused/sign-versions.py +devscripts/gh-pages.unused/update-copyright.py +devscripts/gh-pages.unused/update-feed.py +devscripts/gh-pages.unused/update-sites.py +devscripts/make_issue_template.py +devscripts/release.sh +devscripts/show-downloads-statistics.py +devscripts/wine-py2exe.sh +devscripts/make_readme.py +devscripts/update-formulae.py +devscripts/update-version.py +test/swftests/.gitignore +test/swftests/ArrayAccess.as +test/swftests/ClassCall.as +test/swftests/ClassConstruction.as +test/swftests/ConstArrayAccess.as +test/swftests/ConstantInt.as +test/swftests/DictCall.as +test/swftests/EqualsOperator.as +test/swftests/LocalVars.as +test/swftests/MemberAssignment.as +test/swftests/NeOperator.as +test/swftests/PrivateCall.as +test/swftests/PrivateVoidCall.as +test/swftests/StaticAssignment.as +test/swftests/StaticRetrieval.as +test/swftests/StringBasics.as +test/swftests/StringCharCodeAt.as +test/swftests/StringConversion.as +test/swftests.unused/.gitignore +test/swftests.unused/ArrayAccess.as +test/swftests.unused/ClassCall.as +test/swftests.unused/ClassConstruction.as +test/swftests.unused/ConstArrayAccess.as +test/swftests.unused/ConstantInt.as +test/swftests.unused/DictCall.as +test/swftests.unused/EqualsOperator.as +test/swftests.unused/LocalVars.as +test/swftests.unused/MemberAssignment.as +test/swftests.unused/NeOperator.as +test/swftests.unused/PrivateCall.as +test/swftests.unused/PrivateVoidCall.as +test/swftests.unused/StaticAssignment.as +test/swftests.unused/StaticRetrieval.as +test/swftests.unused/StringBasics.as +test/swftests.unused/StringCharCodeAt.as +test/swftests.unused/StringConversion.as +test/test_iqiyi_sdk_interpreter.py +test/test_swfinterp.py.disabled +test/test_unicode_literals.py.disabled +test/test_update.py.disabled +test/test_write_annotations.py.disabled +test/test_iqiyi_sdk_interpreter.py~upstream_master +test/test_swfinterp.py +test/test_update.py +test/versions.json +yt_dlp/swfinterp.py +yt_dlp/update.py +yt-dlp ytdlp_plugins/ yt-dlp-plugins diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8587fe92..687b0ca5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,63 +1,26 @@ -# CONTRIBUTING TO YT-DLP - -- [OPENING AN ISSUE](#opening-an-issue) - - [Is the description of the issue itself sufficient?](#is-the-description-of-the-issue-itself-sufficient) - - [Are you using the latest version?](#are-you-using-the-latest-version) - - [Is the issue already documented?](#is-the-issue-already-documented) - - [Why are existing options not enough?](#why-are-existing-options-not-enough) - - [Have you read and understood the changes, between youtube-dl and yt-dlp](#have-you-read-and-understood-the-changes-between-youtube-dl-and-yt-dlp) - - [Is there enough context in your bug report?](#is-there-enough-context-in-your-bug-report) - - [Does the issue involve one problem, and one problem only?](#does-the-issue-involve-one-problem-and-one-problem-only) - - [Is anyone going to need the feature?](#is-anyone-going-to-need-the-feature) - - [Is your question about yt-dlp?](#is-your-question-about-yt-dlp) - - [Are you willing to share account details if needed?](#are-you-willing-to-share-account-details-if-needed) - - [Is the website primarily used for piracy](#is-the-website-primarily-used-for-piracy) -- [DEVELOPER INSTRUCTIONS](#developer-instructions) - - [Adding new feature or making overarching changes](#adding-new-feature-or-making-overarching-changes) - - [Adding support for a new site](#adding-support-for-a-new-site) - - [yt-dlp coding conventions](#yt-dlp-coding-conventions) - - [Mandatory and optional metafields](#mandatory-and-optional-metafields) - - [Provide fallbacks](#provide-fallbacks) - - [Regular expressions](#regular-expressions) - - [Long lines policy](#long-lines-policy) - - [Quotes](#quotes) - - [Inline values](#inline-values) - - [Collapse fallbacks](#collapse-fallbacks) - - [Trailing parentheses](#trailing-parentheses) - - [Use convenience conversion and parsing functions](#use-convenience-conversion-and-parsing-functions) - - [My pull request is labeled pending-fixes](#my-pull-request-is-labeled-pending-fixes) -- [EMBEDDING YT-DLP](README.md#embedding-yt-dlp) - - - -# OPENING AN ISSUE - -Bugs and suggestions should be reported at: [yt-dlp/yt-dlp/issues](https://github.com/yt-dlp/yt-dlp/issues). Unless you were prompted to or there is another pertinent reason (e.g. GitHub fails to accept the bug report), please do not send bug reports via personal email. For discussions, join us in our [discord server](https://discord.gg/H5MNcFW63r). - -**Please include the full output of yt-dlp when run with `-vU`**, i.e. **add** `-vU` flag to **your command line**, copy the **whole** output and post it in the issue body wrapped in \`\`\` for better formatting. It should look similar to this: -``` -$ yt-dlp -vU <your command line> -[debug] Command-line config: ['-v', 'demo.com'] -[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8 -[debug] yt-dlp version 2021.09.25 (zip) -[debug] Python version 3.8.10 (CPython 64bit) - Linux-5.4.0-74-generic-x86_64-with-glibc2.29 -[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4 +**Please include the full output of hypervideo when run with `-v`**, i.e. **add** `-v` flag to **your command line**, copy the **whole** output and post it in the issue body wrapped in \`\`\` for better formatting. It should look similar to this: +``` +$ hypervideo -v <your command line> +[debug] System config: [] +[debug] User config: [] +[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=BaW_jenozKcj'] +[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251 +[debug] hypervideo version 1.1.11 +[debug] Git HEAD: 135392e +[debug] Python version 2.6.6 - Windows-2003Server-5.2.3790-SP2 +[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4 [debug] Proxy map: {} -Current Build Hash 25cc412d1d3c0725a1f2f5b7e4682f6fb40e6d15f7024e96f7afd572e9919535 -yt-dlp is up to date (2021.09.25) ... ``` **Do not post screenshots of verbose logs; only plain text is acceptable.** -The output (including the first lines) contains important debugging information. Issues without the full output are often not reproducible and therefore will be closed as `incomplete`. - -The templates provided for the Issues, should be completed and **not removed**, this helps aide the resolution of the issue. +The output (including the first lines) contains important debugging information. Issues without the full output are often not reproducible and therefore do not get solved in short order, if ever. Please re-read your issue once again to avoid a couple of common mistakes (you can and should use this as a checklist): ### Is the description of the issue itself sufficient? -We often get issue reports that we cannot really decipher. While in most cases we eventually get the required information after asking back multiple times, this poses an unnecessary drain on our resources. +We often get issue reports that we cannot really decipher. While in most cases we eventually get the required information after asking back multiple times, this poses an unnecessary drain on our resources. Many contributors, including myself, are also not native speakers, so we may misread some parts. So please elaborate on what feature you are requesting, or what bug you want to be fixed. Make sure that it's obvious @@ -65,17 +28,17 @@ So please elaborate on what feature you are requesting, or what bug you want to - How it could be fixed - How your proposed solution would look like -If your report is shorter than two lines, it is almost certainly missing some of these, which makes it hard for us to respond to it. We're often too polite to close the issue outright, but the missing info makes misinterpretation likely. We often get frustrated by these issues, since the only possible way for us to move forward on them is to ask for clarification over and over. +If your report is shorter than two lines, it is almost certainly missing some of these, which makes it hard for us to respond to it. We're often too polite to close the issue outright, but the missing info makes misinterpretation likely. As a committer myself, I often get frustrated by these issues, since the only possible way for me to move forward on them is to ask for clarification over and over. -For bug reports, this means that your report should contain the **complete** output of yt-dlp when called with the `-vU` flag. The error message you get for (most) bugs even says so, but you would not believe how many of our bug reports do not contain this information. +For bug reports, this means that your report should contain the *complete* output of hypervideo when called with the `-v` flag. The error message you get for (most) bugs even says so, but you would not believe how many of our bug reports do not contain this information. -If the error is `ERROR: Unable to extract ...` and you cannot reproduce it from multiple countries, add `--write-pages` and upload the `.dump` files you get [somewhere](https://gist.github.com). +If your server has multiple IPs or you suspect censorship, adding `--call-home` may be a good idea to get more diagnostics. If the error is `ERROR: Unable to extract ...` and you cannot reproduce it from multiple countries, add `--dump-pages` (warning: this will yield a rather large output, redirect it to the file `log.txt` by adding `>log.txt 2>&1` to your command-line) or upload the `.dump` files you get when you add `--write-pages` [somewhere](https://gist.github.com/). **Site support requests must contain an example URL**. An example URL is a URL you might want to download, like `https://www.youtube.com/watch?v=BaW_jenozKc`. There should be an obvious video present. Except under very special circumstances, the main page of a video service (e.g. `https://www.youtube.com/`) is *not* an example URL. ### Are you using the latest version? -Before reporting any issue, type `yt-dlp -U`. This should report that you're up-to-date. This goes for feature requests as well. +Before reporting any issue, type `doas pacman -Sy hypervideo`. This should report that you're up-to-date. About 20% of the reports we receive are already fixed, but people are using outdated versions. This goes for feature requests as well. ### Is the issue already documented? @@ -85,11 +48,7 @@ Additionally, it is also helpful to see if the issue has already been documented ### Why are existing options not enough? -Before requesting a new feature, please have a quick peek at [the list of supported options](README.md#usage-and-options). Many feature requests are for features that actually exist already! Please, absolutely do show off your work in the issue report and detail how the existing similar options do *not* solve your problem. - -### Have you read and understood the changes, between youtube-dl and yt-dlp - -There are many changes between youtube-dl and yt-dlp [(changes to default behavior)](README.md#differences-in-default-behavior), and some of the options available have a different behaviour in yt-dlp, or have been removed all together [(list of changes to options)](README.md#deprecated-options). Make sure you have read and understand the differences in the options and how this may impact your downloads before opening an issue. +Before requesting a new feature, please have a quick peek at [the list of supported options](https://github.com/ytdl-org/youtube-dl/blob/master/README.md#options). Many feature requests are for features that actually exist already! Please, absolutely do show off your work in the issue report and detail how the existing similar options do *not* solve your problem. ### Is there enough context in your bug report? @@ -101,7 +60,7 @@ We are then presented with a very complicated request when the original problem Some of our users seem to think there is a limit of issues they can or should open. There is no limit of issues they can or should open. While it may seem appealing to be able to dump all your issues into one ticket, that means that someone who solves one of your issues cannot mark the issue as closed. Typically, reporting a bunch of issues leads to the ticket lingering since nobody wants to attack that behemoth, until someone mercifully splits the issue into multiple ones. -In particular, every site support request issue should only pertain to services at one site (generally under a common domain, but always using the same backend technology). Do not request support for vimeo user videos, White house podcasts, and Google Plus pages in the same issue. Also, make sure that you don't post bug reports alongside feature requests. As a rule of thumb, a feature request does not include outputs of yt-dlp that are not immediately related to the feature at hand. Do not post reports of a network error alongside the request for a new video service. +In particular, every site support request issue should only pertain to services at one site (generally under a common domain, but always using the same backend technology). Do not request support for vimeo user videos, White house podcasts, and Google Plus pages in the same issue. Also, make sure that you don't post bug reports alongside feature requests. As a rule of thumb, a feature request does not include outputs of hypervideo that are not immediately related to the feature at hand. Do not post reports of a network error alongside the request for a new video service. ### Is anyone going to need the feature? @@ -127,63 +86,64 @@ While these steps won't necessarily ensure that no misuse of the account takes p ### Is the website primarily used for piracy? -We follow [youtube-dl's policy](https://github.com/ytdl-org/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free) to not support services that is primarily used for infringing copyright. Additionally, it has been decided to not to support porn sites that specialize in fakes. We also cannot support any service that serves only [DRM protected content](https://en.wikipedia.org/wiki/Digital_rights_management). +We follow [youtube-dl's policy](https://github.com/ytdl-org/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free) to not support services that is primarily used for infringing copyright. Additionally, it has been decided to not to support porn sites that specialize in fakes. We also cannot support any service that serves only [DRM protected content](https://en.wikipedia.org/wiki/Digital_rights_management). +It may sound strange, but some bug reports we receive are completely unrelated to hypervideo and relate to a different, or even the reporter's own, application. Please make sure that you are actually using hypervideo. If you are using a UI for hypervideo, report the bug to the maintainer of the actual application providing the UI. On the other hand, if your UI for hypervideo fails in some way you believe is related to hypervideo, by all means, go ahead and report the bug. # DEVELOPER INSTRUCTIONS -Most users do not need to build yt-dlp and can [download the builds](https://github.com/yt-dlp/yt-dlp/releases) or get them via [the other installation methods](README.md#installation). +Most users do not need to build hypervideo and can [download the builds](https://ytdl-org.github.io/youtube-dl/download.html) or get them from their distribution. -To run yt-dlp as a developer, you don't need to build anything either. Simply execute +To run hypervideo as a developer, you don't need to build anything either. Simply execute - python -m yt_dlp + python -m hypervideo_dl To run the test, simply invoke your favorite test runner, or execute a test file directly; any of the following work: python -m unittest discover python test/test_download.py nosetests - pytest See item 6 of [new extractor tutorial](#adding-support-for-a-new-site) for how to run extractor specific test cases. -If you want to create a build of yt-dlp yourself, you can follow the instructions [here](README.md#compile). - +If you want to create a build of hypervideo yourself, you'll need -## Adding new feature or making overarching changes +* python +* make (only GNU make is supported) +* pandoc +* zip +* nosetests -Before you start writing code for implementing a new feature, open an issue explaining your feature request and atleast one use case. This allows the maintainers to decide whether such a feature is desired for the project in the first place, and will provide an avenue to discuss some implementation details. If you open a pull request for a new feature without discussing with us first, do not be surprised when we ask for large changes to the code, or even reject it outright. +### Adding support for a new site -The same applies for changes to the documentation, code style, or overarching changes to the architecture - - -## Adding support for a new site - -If you want to add support for a new site, first of all **make sure** this site is **not dedicated to [copyright infringement](#is-the-website-primarily-used-for-piracy)**. yt-dlp does **not support** such sites thus pull requests adding support for them **will be rejected**. +If you want to add support for a new site, first of all **make sure** this site is **not dedicated to [copyright infringement](README.md#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free)**. hypervideo does **not support** such sites thus pull requests adding support for them **will be rejected**. After you have ensured this site is distributing its content legally, you can follow this quick list (assuming your service is called `yourextractor`): -1. [Fork this repository](https://github.com/yt-dlp/yt-dlp/fork) -1. Check out the source code with: +1. [Fork this repository](https://c.hgit.ga/software/hypervideo) +2. Check out the source code with: - git clone git@github.com:YOUR_GITHUB_USERNAME/yt-dlp.git + git clone https://c.hgit.ga/software/hypervideo -1. Start a new git branch with +3. Start a new git branch with - cd yt-dlp + cd hypervideo git checkout -b yourextractor -1. Start with this simple template and save it to `yt_dlp/extractor/yourextractor.py`: +4. Start with this simple template and save it to `hypervideo_dl/extractor/yourextractor.py`: ```python + # coding: utf-8 + from __future__ import unicode_literals + from .common import InfoExtractor - - + + class YourExtractorIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?yourextractor\.com/watch/(?P<id>[0-9]+)' - _TESTS = [{ + _TEST = { 'url': 'https://yourextractor.com/watch/42', 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', 'info_dict': { @@ -195,14 +155,14 @@ After you have ensured this site is distributing its content legally, you can fo # * A value # * MD5 checksum; start the string with md5: # * A regular expression; start the string with re: - # * Any Python type, e.g. int or float + # * Any Python type (for example int or float) } - }] + } def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - + # TODO more code goes here, for example ... title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title') @@ -211,38 +171,29 @@ After you have ensured this site is distributing its content legally, you can fo 'title': title, 'description': self._og_search_description(webpage), 'uploader': self._search_regex(r'<div[^>]+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False), - # TODO more properties (see yt_dlp/extractor/common.py) + # TODO more properties (see hypervideo_dl/extractor/common.py) } ``` -1. Add an import in [`yt_dlp/extractor/_extractors.py`](yt_dlp/extractor/_extractors.py). Note that the class name must end with `IE`. -1. Run `python test/test_download.py TestDownload.test_YourExtractor` (note that `YourExtractor` doesn't end with `IE`). This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, the tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. Note that tests with `only_matching` key in test's dict are not counted in. You can also run all the tests in one go with `TestDownload.test_YourExtractor_all` -1. Make sure you have atleast one test for your extractor. Even if all videos covered by the extractor are expected to be inaccessible for automated testing, tests should still be added with a `skip` parameter indicating why the particular test is disabled from running. -1. Have a look at [`yt_dlp/extractor/common.py`](yt_dlp/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](yt_dlp/extractor/common.py#L91-L426). Add tests and code for as many as you want. -1. Make sure your code follows [yt-dlp coding conventions](#yt-dlp-coding-conventions) and check the code with [flake8](https://flake8.pycqa.org/en/latest/index.html#quickstart): +5. Add an import in [`hypervideo_dl/extractor/extractors.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/extractors.py). +6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. Note that tests with `only_matching` key in test's dict are not counted in. +7. Have a look at [`hypervideo_dl/extractor/common.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/ytdl-org/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L94-L303). Add tests and code for as many as you want. +8. Make sure your code follows [hypervideo coding conventions](#hypervideo-coding-conventions) and check the code with [flake8](https://flake8.pycqa.org/en/latest/index.html#quickstart): - $ flake8 yt_dlp/extractor/yourextractor.py + $ flake8 hypervideo_dl/extractor/yourextractor.py -1. Make sure your code works under all [Python](https://www.python.org/) versions supported by yt-dlp, namely CPython and PyPy for Python 3.7 and above. Backward compatibility is not required for even older versions of Python. -1. When the tests pass, [add](https://git-scm.com/docs/git-add) the new files, [commit](https://git-scm.com/docs/git-commit) them and [push](https://git-scm.com/docs/git-push) the result, like this: +9. Make sure your code works under all [Python](https://www.python.org/) versions claimed supported by hypervideo, namely 2.6, 2.7, and 3.2+. +10. When the tests pass, [add](https://git-scm.com/docs/git-add) the new files and [commit](https://git-scm.com/docs/git-commit) them and [push](https://git-scm.com/docs/git-push) the result, like this: - $ git add yt_dlp/extractor/_extractors.py - $ git add yt_dlp/extractor/yourextractor.py - $ git commit -m '[yourextractor] Add extractor' + $ git add hypervideo_dl/extractor/extractors.py + $ git add hypervideo_dl/extractor/yourextractor.py + $ git commit -m '[yourextractor] Add new extractor' $ git push origin yourextractor -1. Finally, [create a pull request](https://help.github.com/articles/creating-a-pull-request). We'll then review and merge it. +11. Finally, [create a pull request](https://help.github.com/articles/creating-a-pull-request). We'll then review and merge it. In any case, thank you very much for your contributions! -**Tip:** To test extractors that require login information, create a file `test/local_parameters.json` and add `"usenetrc": true` or your username and password in it: -```json -{ - "username": "your user name", - "password": "your password" -} -``` - -## yt-dlp coding conventions +## hypervideo coding conventions This section introduces a guide lines for writing idiomatic, robust and future-proof extractor code. @@ -251,19 +202,15 @@ Extractors are very fragile by nature since they depend on the layout of the sou ### Mandatory and optional metafields -For extraction to work yt-dlp relies on metadata your extractor extracts and provides to yt-dlp expressed by an [information dictionary](yt_dlp/extractor/common.py#L91-L426) or simply *info dict*. Only the following meta fields in the *info dict* are considered mandatory for a successful extraction process by yt-dlp: +For extraction to work hypervideo relies on metadata your extractor extracts and provides to hypervideo expressed by an [information dictionary](https://github.com/ytdl-org/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L94-L303) or simply *info dict*. Only the following meta fields in the *info dict* are considered mandatory for a successful extraction process by youtube-dl: - `id` (media identifier) - `title` (media title) - `url` (media download URL) or `formats` -The aforementioned metafields are the critical data that the extraction does not make any sense without and if any of them fail to be extracted then the extractor is considered completely broken. While all extractors must return a `title`, they must also allow it's extraction to be non-fatal. - -For pornographic sites, appropriate `age_limit` must also be returned. - -The extractor is allowed to return the info dict without url or formats in some special cases if it allows the user to extract usefull information with `--ignore-no-formats-error` - e.g. when the video is a live stream that has not started yet. +In fact only the last option is technically mandatory (i.e. if you can't figure out the download location of the media the extraction does not make any sense). But by convention hypervideo also treats `id` and `title` as mandatory. Thus the aforementioned metafields are the critical data that the extraction does not make any sense without and if any of them fail to be extracted then the extractor is considered completely broken. -[Any field](yt_dlp/extractor/common.py#219-L426) apart from the aforementioned ones are considered **optional**. That means that extraction should be **tolerant** to situations when sources for these fields can potentially be unavailable (even if they are always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields. +[Any field](https://github.com/ytdl-org/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L188-L303) apart from the aforementioned ones are considered **optional**. That means that extraction should be **tolerant** to situations when sources for these fields can potentially be unavailable (even if they are always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields. #### Example @@ -272,15 +219,13 @@ Say you have some source dictionary `meta` that you've fetched as JSON with HTTP ```python meta = self._download_json(url, video_id) ``` - + Assume at this point `meta`'s layout is: ```python { + ... "summary": "some fancy summary text", - "user": { - "name": "uploader name" - }, ... } ``` @@ -299,30 +244,6 @@ description = meta['summary'] # incorrect The latter will break extraction process with `KeyError` if `summary` disappears from `meta` at some later time but with the former approach extraction will just go ahead with `description` set to `None` which is perfectly fine (remember `None` is equivalent to the absence of data). - -If the data is nested, do not use `.get` chains, but instead make use of `traverse_obj`. - -Considering the above `meta` again, assume you want to extract `["user"]["name"]` and put it in the resulting info dict as `uploader` - -```python -uploader = traverse_obj(meta, ('user', 'name')) # correct -``` - -and not like: - -```python -uploader = meta['user']['name'] # incorrect -``` -or -```python -uploader = meta.get('user', {}).get('name') # incorrect -``` -or -```python -uploader = try_get(meta, lambda x: x['user']['name']) # old utility -``` - - Similarly, you should pass `fatal=False` when extracting optional data from a webpage with `_search_regex`, `_html_search_regex` or similar methods, for instance: ```python @@ -387,25 +308,23 @@ thumbnails = traverse_obj(data, ('thumbnails', ..., {'url': 'url', 'height': 'h' When extracting metadata try to do so from multiple sources. For example if `title` is present in several places, try extracting from at least some of them. This makes it more future-proof in case some of the sources become unavailable. - #### Example -Say `meta` from the previous example has a `title` and you are about to extract it like: +Say `meta` from the previous example has a `title` and you are about to extract it. Since `title` is a mandatory meta field you should end up with something like: ```python -title = meta.get('title') +title = meta['title'] ``` -If `title` disappears from `meta` in future due to some changes on the hoster's side the title extraction would fail. +If `title` disappears from `meta` in future due to some changes on the hoster's side the extraction would fail since `title` is mandatory. That's expected. -Assume that you have some another source you can extract `title` from, for example `og:title` HTML meta of a `webpage`. In this case you can provide a fallback like: +Assume that you have some another source you can extract `title` from, for example `og:title` HTML meta of a `webpage`. In this case you can provide a fallback scenario: ```python title = meta.get('title') or self._og_search_title(webpage) ``` -This code will try to extract from `meta` first and if it fails it will try extracting `og:title` from a `webpage`, making the extractor more robust. - +This code will try to extract from `meta` first and if it fails it will try extracting `og:title` from a `webpage`. ### Regular expressions @@ -428,6 +347,7 @@ Incorrect: r'(id|ID)=(?P<id>\d+)' ``` + #### Make regular expressions relaxed and flexible When using regular expressions try to write them fuzzy, relaxed and flexible, skipping insignificant parts that are more likely to change, allowing both single and double quotes for quoted values and so on. @@ -443,84 +363,34 @@ Say you need to extract `title` from the following HTML code: The code for that task should look similar to: ```python -title = self._search_regex( # correct +title = self._search_regex( r'<span[^>]+class="title"[^>]*>([^<]+)', webpage, 'title') ``` -which tolerates potential changes in the `style` attribute's value. Or even better: +Or even better: ```python -title = self._search_regex( # correct +title = self._search_regex( r'<span[^>]+class=(["\'])title\1[^>]*>(?P<title>[^<]+)', webpage, 'title', group='title') ``` -which also handles both single quotes in addition to double quotes. +Note how you tolerate potential changes in the `style` attribute's value or switch from using double quotes to single for `class` attribute: The code definitely should not look like: ```python -title = self._search_regex( # incorrect +title = self._search_regex( r'<span style="position: absolute; left: 910px; width: 90px; float: right; z-index: 9999;" class="title">(.*?)</span>', webpage, 'title', group='title') ``` -or even - -```python -title = self._search_regex( # incorrect - r'<span style=".*?" class="title">(.*?)</span>', - webpage, 'title', group='title') -``` - -Here the presence or absence of other attributes including `style` is irrelevant for the data we need, and so the regex must not depend on it - - -#### Keep the regular expressions as simple as possible, but no simpler - -Since many extractors deal with unstructured data provided by websites, we will often need to use very complex regular expressions. You should try to use the *simplest* regex that can accomplish what you want. In other words, each part of the regex must have a reason for existing. If you can take out a symbol and the functionality does not change, the symbol should not be there. - -##### Example - -Correct: - -```python -_VALID_URL = r'https?://(?:www\.)?website\.com/(?:[^/]+/){3,4}(?P<display_id>[^/]+)_(?P<id>\d+)' -``` - -Incorrect: - -```python -_VALID_URL = r'https?:\/\/(?:www\.)?website\.com\/[^\/]+/[^\/]+/[^\/]+(?:\/[^\/]+)?\/(?P<display_id>[^\/]+)_(?P<id>\d+)' -``` - -#### Do not misuse `.` and use the correct quantifiers (`+*?`) - -Avoid creating regexes that over-match because of wrong use of quantifiers. Also try to avoid non-greedy matching (`?`) where possible since they could easily result in [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html) - -Correct: - -```python -title = self._search_regex(r'<span\b[^>]+class="title"[^>]*>([^<]+)', webpage, 'title') -``` - -Incorrect: - -```python -title = self._search_regex(r'<span\b.*class="title".*>(.+?)<', webpage, 'title') -``` - - ### Long lines policy -There is a soft limit to keep lines of code under 100 characters long. This means it should be respected if possible and if it does not make readability and code maintenance worse. Sometimes, it may be reasonable to go upto 120 characters and sometimes even 80 can be unreadable. Keep in mind that this is not a hard limit and is just one of many tools to make the code more readable. +There is a soft limit to keep lines of code under 80 characters long. This means it should be respected if possible and if it does not make readability and code maintenance worse. For example, you should **never** split long string literals like URLs or some other often copied entities over multiple lines to fit this limit: -Conversely, don't unnecessarily split small lines further. As a rule of thumb, if removing the line split keeps the code under 80 characters, it should be a single line. - -##### Examples - Correct: ```python @@ -534,76 +404,26 @@ Incorrect: 'PLMYEtVRpaqY00V9W81Cwmzp6N6vZqfUKD4' ``` -Correct: - -```python -uploader = traverse_obj(info, ('uploader', 'name'), ('author', 'fullname')) -``` - -Incorrect: - -```python -uploader = traverse_obj( - info, - ('uploader', 'name'), - ('author', 'fullname')) -``` - -Correct: - -```python -formats = self._extract_m3u8_formats( - m3u8_url, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', - note='Downloading HD m3u8 information', errnote='Unable to download HD m3u8 information') -``` - -Incorrect: - -```python -formats = self._extract_m3u8_formats(m3u8_url, - video_id, - 'mp4', - 'm3u8_native', - m3u8_id='hls', - note='Downloading HD m3u8 information', - errnote='Unable to download HD m3u8 information') -``` - - -### Quotes - -Always use single quotes for strings (even if the string has `'`) and double quotes for docstrings. Use `'''` only for multi-line strings. An exception can be made if a string has multiple single quotes in it and escaping makes it *significantly* harder to read. For f-strings, use you can use double quotes on the inside. But avoid f-strings that have too many quotes inside. - - ### Inline values Extracting variables is acceptable for reducing code duplication and improving readability of complex expressions. However, you should avoid extracting variables used only once and moving them to opposite parts of the extractor file, which makes reading the linear flow difficult. -#### Examples +#### Example Correct: ```python -return { - 'title': self._html_search_regex(r'<h1>([^<]+)</h1>', webpage, 'title'), - # ...some lines of code... -} +title = self._html_search_regex(r'<title>([^<]+)</title>', webpage, 'title') ``` Incorrect: ```python -TITLE_RE = r'<h1>([^<]+)</h1>' +TITLE_RE = r'<title>([^<]+)</title>' # ...some lines of code... title = self._html_search_regex(TITLE_RE, webpage, 'title') -# ...some lines of code... -return { - 'title': title, - # ...some lines of code... -} ``` - ### Collapse fallbacks Multiple fallback values can quickly become unwieldy. Collapse multiple fallback values into a single expression via a list of patterns. @@ -629,100 +449,52 @@ description = ( Methods supporting list of patterns are: `_search_regex`, `_html_search_regex`, `_og_search_property`, `_html_search_meta`. - ### Trailing parentheses -Always move trailing parentheses used for grouping/functions after the last argument. On the other hand, multi-line literal list/tuple/dict/set should closed be in a new line. Generators and list/dict comprehensions may use either style +Always move trailing parentheses after the last argument. -#### Examples - -Correct: +#### Example -```python -url = traverse_obj(info, ( - 'context', 'dispatcher', 'stores', 'VideoTitlePageStore', 'data', 'video', 0, 'VideoUrlSet', 'VideoUrl'), list) -``` Correct: ```python -url = traverse_obj( - info, - ('context', 'dispatcher', 'stores', 'VideoTitlePageStore', 'data', 'video', 0, 'VideoUrlSet', 'VideoUrl'), + lambda x: x['ResultSet']['Result'][0]['VideoUrlSet']['VideoUrl'], list) ``` Incorrect: ```python -url = traverse_obj( - info, - ('context', 'dispatcher', 'stores', 'VideoTitlePageStore', 'data', 'video', 0, 'VideoUrlSet', 'VideoUrl'), - list + lambda x: x['ResultSet']['Result'][0]['VideoUrlSet']['VideoUrl'], + list, ) ``` -Correct: +### Use convenience conversion and parsing functions -```python -f = { - 'url': url, - 'format_id': format_id, -} -``` +Wrap all extracted numeric data into safe functions from [`hypervideo_dl/utils.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/utils.py): `int_or_none`, `float_or_none`. Use them for string to number conversions as well. -Incorrect: +Use `url_or_none` for safe URL processing. -```python -f = {'url': url, - 'format_id': format_id} -``` +Use `try_get` for safe metadata extraction from parsed JSON. -Correct: +Use `unified_strdate` for uniform `upload_date` or any `YYYYMMDD` meta field extraction, `unified_timestamp` for uniform `timestamp` extraction, `parse_filesize` for `filesize` extraction, `parse_count` for count meta fields extraction, `parse_resolution`, `parse_duration` for `duration` extraction, `parse_age_limit` for `age_limit` extraction. -```python -formats = [process_formats(f) for f in format_data - if f.get('type') in ('hls', 'dash', 'direct') and f.get('downloadable')] -``` +Explore [`hypervideo_dl/utils.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/utils.py) for more useful convenience functions. -Correct: +#### More examples + +##### Safely extract optional description from parsed JSON ```python -formats = [ - process_formats(f) for f in format_data - if f.get('type') in ('hls', 'dash', 'direct') and f.get('downloadable') -] +description = try_get(response, lambda x: x['result']['video'][0]['summary'], compat_str) ``` - -### Use convenience conversion and parsing functions - -Wrap all extracted numeric data into safe functions from [`yt_dlp/utils.py`](yt_dlp/utils.py): `int_or_none`, `float_or_none`. Use them for string to number conversions as well. - -Use `url_or_none` for safe URL processing. - -Use `traverse_obj` and `try_call` (superseeds `dict_get` and `try_get`) for safe metadata extraction from parsed JSON. - -Use `unified_strdate` for uniform `upload_date` or any `YYYYMMDD` meta field extraction, `unified_timestamp` for uniform `timestamp` extraction, `parse_filesize` for `filesize` extraction, `parse_count` for count meta fields extraction, `parse_resolution`, `parse_duration` for `duration` extraction, `parse_age_limit` for `age_limit` extraction. - -Explore [`yt_dlp/utils.py`](yt_dlp/utils.py) for more useful convenience functions. - -#### Examples +##### Safely extract more optional metadata ```python -description = traverse_obj(response, ('result', 'video', 'summary'), expected_type=str) -thumbnails = traverse_obj(response, ('result', 'thumbnails', ..., 'url'), expected_type=url_or_none) -video = traverse_obj(response, ('result', 'video', 0), default={}, expected_type=dict) +video = try_get(response, lambda x: x['result']['video'][0], dict) or {} +description = video.get('summary') duration = float_or_none(video.get('durationMs'), scale=1000) view_count = int_or_none(video.get('views')) ``` - - -# My pull request is labeled pending-fixes - -The `pending-fixes` label is added when there are changes requested to a PR. When the necessary changes are made, the label should be removed. However, despite our best efforts, it may sometimes happen that the maintainer did not see the changes or forgot to remove the label. If your PR is still marked as `pending-fixes` a few days after all requested changes have been made, feel free to ping the maintainer who labeled your issue and ask them to re-review and remove the label. - - - - -# EMBEDDING YT-DLP -See [README.md#embedding-yt-dlp](README.md#embedding-yt-dlp) for instructions on how to embed yt-dlp in another Python program diff --git a/Changelog.md b/Changelog.md index 32cdaca2a..b0b78ac19 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2386,7 +2386,7 @@ * [update] Check for new version even if not updateable * [build] Add more files to the tarball * [build] Allow building with py2exe (and misc fixes) -* [build] Use pycryptodomex by [shirt](https://github.com/shirt-dev), [pukkandan](https://github.com/pukkandan) +* [build] Use pycryptodome by [shirt](https://github.com/shirt-dev), [pukkandan](https://github.com/pukkandan) * [cleanup] Some minor refactoring, improve docs and misc cleanup diff --git a/Collaborators.md b/Collaborators.md deleted file mode 100644 index 70ab616f1..000000000 --- a/Collaborators.md +++ /dev/null @@ -1,61 +0,0 @@ -# Collaborators - -This is a list of the collaborators of the project and their major contributions. See the [Changelog](Changelog.md) for more details. - -You can also find lists of all [contributors of yt-dlp](CONTRIBUTORS) and [authors of youtube-dl](https://github.com/ytdl-org/youtube-dl/blob/master/AUTHORS) - - -## [pukkandan](https://github.com/pukkandan) - -[](https://ko-fi.com/pukkandan) -[](https://github.com/sponsors/pukkandan) - -* Owner of the fork - - - -## [shirt](https://github.com/shirt-dev) - -[](https://ko-fi.com/shirt) - -* Multithreading (`-N`) and aria2c support for fragment downloads -* Support for media initialization and discontinuity in HLS -* The self-updater (`-U`) - - - -## [coletdjnz](https://github.com/coletdjnz) - -[](https://github.com/sponsors/coletdjnz) - -* Improved plugin architecture -* YouTube improvements including: age-gate bypass, private playlists, multiple-clients (to avoid throttling) and a lot of under-the-hood improvements -* Added support for new websites YoutubeWebArchive, MainStreaming, PRX, nzherald, Mediaklikk, StarTV etc -* Improved/fixed support for Patreon, panopto, gfycat, itv, pbs, SouthParkDE etc - - - -## [Ashish0804](https://github.com/Ashish0804) <sub><sup>[Inactive]</sup></sub> - -[](https://ko-fi.com/ashish0804) - -* Added support for new websites BiliIntl, DiscoveryPlusIndia, OlympicsReplay, PlanetMarathi, ShemarooMe, Utreon, Zee5 etc -* Added playlist/series downloads for Hotstar, ParamountPlus, Rumble, SonyLIV, Trovo, TubiTv, Voot etc -* Improved/fixed support for HiDive, HotStar, Hungama, LBRY, LinkedInLearning, Mxplayer, SonyLiv, TV2, Vimeo, VLive etc - - -## [bashonly](https://github.com/bashonly) - -* `--update-to`, automated release, nightly builds -* `--cookies-from-browser` support for Firefox containers -* Added support for new websites Genius, Kick, NBCStations, Triller, VideoKen etc -* Improved/fixed support for Anvato, Brightcove, Instagram, ParamountPlus, Reddit, SlidesLive, TikTok, Twitter, Vimeo etc - - -## [Grub4K](https://github.com/Grub4K) - -[](https://ko-fi.com/Grub4K) [](https://github.com/sponsors/Grub4K) - -* `--update-to`, automated release, nightly builds -* Rework internals like `traverse_obj`, various core refactors and bugs fixes -* Helped fix crunchyroll, Twitter, wrestleuniverse, wistia, slideslive etc @@ -1,24 +1,121 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to <http://unlicense.org/> +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. @@ -1,31 +1,26 @@ -all: lazy-extractors yt-dlp doc pypi-files -clean: clean-test clean-dist -clean-all: clean clean-cache +all: yt-dlp doc pypi-files +clean: clean-test clean-dist clean-cache completions: completion-bash completion-fish completion-zsh -doc: README.md CONTRIBUTING.md issuetemplates supportedsites +doc: README.md CONTRIBUTING.md ot: offlinetest tar: yt-dlp.tar.gz # Keep this list in sync with MANIFEST.in # intended use: when building a source distribution, # make pypi-files && python setup.py sdist -pypi-files: AUTHORS Changelog.md LICENSE README.md README.txt supportedsites \ - completions yt-dlp.1 requirements.txt setup.cfg devscripts/* test/* +pypi-files: AUTHORS Changelog.md LICENSE README.md completions devscripts/* test/* -.PHONY: all clean install test tar pypi-files completions ot offlinetest codetest supportedsites +.PHONY: all clean install test tar pypi-files completions ot offlinetest codetest clean-test: - rm -rf test/testdata/sigs/player-*.js tmp/ *.annotations.xml *.aria2 *.description *.dump *.frag \ + rm -rf test/testdata/sigs/player-*.js tmp/ *.annotations.xml *.aria2 *.description *.dump *.frag *.frag.urls \ *.frag.aria2 *.frag.urls *.info.json *.live_chat.json *.meta *.part* *.tmp *.temp *.unknown_video *.ytdl \ *.3gp *.ape *.ass *.avi *.desktop *.f4v *.flac *.flv *.gif *.jpeg *.jpg *.m4a *.m4v *.mhtml *.mkv *.mov *.mp3 \ - *.mp4 *.mpga *.oga *.ogg *.opus *.png *.sbv *.srt *.swf *.swp *.tt *.ttml *.url *.vtt *.wav *.webloc *.webm *.webp + *.mp4 *.mpga *.oga *.ogg *.opus *.png *.sbv *.srt *.swf *.swp *.tt *.ttml *.url *.vtt *.wav *.webloc *.webm *.webp *.ytdl clean-dist: - rm -rf yt-dlp.1.temp.md yt-dlp.1 README.txt MANIFEST build/ dist/ .coverage cover/ yt-dlp.tar.gz completions/ \ - yt_dlp/extractor/lazy_extractors.py *.spec CONTRIBUTING.md.tmp yt-dlp yt-dlp.exe yt_dlp.egg-info/ AUTHORS .mailmap + rm -rf MANIFEST build/ dist/ .coverage cover/ yt-dlp.tar.gz completions/ yt_dlp/extractor/lazy_extractors.py *.spec CONTRIBUTING.md.tmp yt-dlp yt-dlp.exe yt_dlp.egg-info/ AUTHORS .mailmap clean-cache: - find . \( \ - -type d -name .pytest_cache -o -type d -name __pycache__ -o -name "*.pyc" -o -name "*.class" \ - \) -prune -exec rm -rf {} \; + find . -name "*.pyc" -o -name "*.class" -delete completion-bash: completions/bash/yt-dlp completion-fish: completions/fish/yt-dlp.fish @@ -33,6 +28,7 @@ completion-zsh: completions/zsh/_yt-dlp lazy-extractors: yt_dlp/extractor/lazy_extractors.py PREFIX ?= /usr/local +DESTDIR ?= . BINDIR ?= $(PREFIX)/bin MANDIR ?= $(PREFIX)/man SHAREDIR ?= $(PREFIX)/share @@ -41,27 +37,11 @@ PYTHON ?= /usr/bin/env python3 # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi) -# set markdown input format to "markdown-smart" for pandoc version 2 and to "markdown" for pandoc prior to version 2 -MARKDOWN = $(shell if [ `pandoc -v | head -n1 | cut -d" " -f2 | head -c1` = "2" ]; then echo markdown-smart; else echo markdown; fi) - -install: lazy-extractors yt-dlp yt-dlp.1 completions - mkdir -p $(DESTDIR)$(BINDIR) - install -m755 yt-dlp $(DESTDIR)$(BINDIR)/yt-dlp - mkdir -p $(DESTDIR)$(MANDIR)/man1 - install -m644 yt-dlp.1 $(DESTDIR)$(MANDIR)/man1/yt-dlp.1 - mkdir -p $(DESTDIR)$(SHAREDIR)/bash-completion/completions - install -m644 completions/bash/yt-dlp $(DESTDIR)$(SHAREDIR)/bash-completion/completions/yt-dlp - mkdir -p $(DESTDIR)$(SHAREDIR)/zsh/site-functions - install -m644 completions/zsh/_yt-dlp $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_yt-dlp - mkdir -p $(DESTDIR)$(SHAREDIR)/fish/vendor_completions.d - install -m644 completions/fish/yt-dlp.fish $(DESTDIR)$(SHAREDIR)/fish/vendor_completions.d/yt-dlp.fish - -uninstall: - rm -f $(DESTDIR)$(BINDIR)/yt-dlp - rm -f $(DESTDIR)$(MANDIR)/man1/yt-dlp.1 - rm -f $(DESTDIR)$(SHAREDIR)/bash-completion/completions/yt-dlp - rm -f $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_yt-dlp - rm -f $(DESTDIR)$(SHAREDIR)/fish/vendor_completions.d/yt-dlp.fish +install: yt-dlp completions + install -Dm755 yt-dlp $(DESTDIR)$(BINDIR) + install -Dm644 completions/bash/yt-dlp $(DESTDIR)$(SHAREDIR)/bash-completion/completions/yt-dlp + install -Dm644 completions/zsh/_yt-dlp $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_yt-dlp + install -Dm644 completions/fish/yt-dlp.fish $(DESTDIR)$(SHAREDIR)/fish/vendor_completions.d/yt-dlp.fish codetest: flake8 . @@ -73,11 +53,9 @@ test: offlinetest: codetest $(PYTHON) -m pytest -k "not download" -# XXX: This is hard to maintain -CODE_FOLDERS = yt_dlp yt_dlp/downloader yt_dlp/extractor yt_dlp/postprocessor yt_dlp/compat yt_dlp/compat/urllib yt_dlp/utils yt_dlp/dependencies yt_dlp/networking yt-dlp: yt_dlp/*.py yt_dlp/*/*.py mkdir -p zip - for d in $(CODE_FOLDERS) ; do \ + for d in yt_dlp yt_dlp/downloader yt_dlp/extractor yt_dlp/postprocessor ; do \ mkdir -p zip/$$d ;\ cp -pPR $$d/*.py zip/$$d/ ;\ done @@ -90,31 +68,12 @@ yt-dlp: yt_dlp/*.py yt_dlp/*/*.py rm yt-dlp.zip chmod a+x yt-dlp -README.md: yt_dlp/*.py yt_dlp/*/*.py devscripts/make_readme.py - COLUMNS=80 $(PYTHON) yt_dlp/__main__.py --ignore-config --help | $(PYTHON) devscripts/make_readme.py +README.md: yt_dlp/*.py yt_dlp/*/*.py + COLUMNS=80 $(PYTHON) yt_dlp/__main__.py --help | $(PYTHON) devscripts/make_readme.py -CONTRIBUTING.md: README.md devscripts/make_contributing.py +CONTRIBUTING.md: README.md $(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md -issuetemplates: devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.yml .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.yml .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.yml .github/ISSUE_TEMPLATE_tmpl/4_bug_report.yml .github/ISSUE_TEMPLATE_tmpl/5_feature_request.yml yt_dlp/version.py - $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.yml .github/ISSUE_TEMPLATE/1_broken_site.yml - $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.yml .github/ISSUE_TEMPLATE/2_site_support_request.yml - $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.yml .github/ISSUE_TEMPLATE/3_site_feature_request.yml - $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/4_bug_report.yml .github/ISSUE_TEMPLATE/4_bug_report.yml - $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/5_feature_request.yml .github/ISSUE_TEMPLATE/5_feature_request.yml - $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/6_question.yml .github/ISSUE_TEMPLATE/6_question.yml - -supportedsites: - $(PYTHON) devscripts/make_supportedsites.py supportedsites.md - -README.txt: README.md - pandoc -f $(MARKDOWN) -t plain README.md -o README.txt - -yt-dlp.1: README.md devscripts/prepare_manpage.py - $(PYTHON) devscripts/prepare_manpage.py yt-dlp.1.temp.md - pandoc -s -f $(MARKDOWN) -t man yt-dlp.1.temp.md -o yt-dlp.1 - rm -f yt-dlp.1.temp.md - completions/bash/yt-dlp: yt_dlp/*.py yt_dlp/*/*.py devscripts/bash-completion.in mkdir -p completions/bash $(PYTHON) devscripts/bash-completion.py @@ -127,12 +86,12 @@ completions/fish/yt-dlp.fish: yt_dlp/*.py yt_dlp/*/*.py devscripts/fish-completi mkdir -p completions/fish $(PYTHON) devscripts/fish-completion.py -_EXTRACTOR_FILES = $(shell find yt_dlp/extractor -name '*.py' -and -not -name 'lazy_extractors.py') +_EXTRACTOR_FILES = $(shell find yt_dlp/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py') yt_dlp/extractor/lazy_extractors.py: devscripts/make_lazy_extractors.py devscripts/lazy_load_template.py $(_EXTRACTOR_FILES) $(PYTHON) devscripts/make_lazy_extractors.py $@ yt-dlp.tar.gz: all - @tar -czf yt-dlp.tar.gz --transform "s|^|yt-dlp/|" --owner 0 --group 0 \ + @tar -czf $(DESTDIR)/yt-dlp.tar.gz --transform "s|^|yt-dlp/|" --owner 0 --group 0 \ --exclude '*.DS_Store' \ --exclude '*.kate-swp' \ --exclude '*.pyc' \ @@ -142,9 +101,9 @@ yt-dlp.tar.gz: all --exclude '.pytest_cache' \ --exclude '.git' \ -- \ - README.md supportedsites.md Changelog.md LICENSE \ - CONTRIBUTING.md Collaborators.md CONTRIBUTORS AUTHORS \ - Makefile MANIFEST.in yt-dlp.1 README.txt completions \ + bin README.md Changelog.md LICENSE \ + CONTRIBUTING.md CONTRIBUTORS AUTHORS \ + Makefile MANIFEST.in README.md completions \ setup.py setup.cfg yt-dlp yt_dlp requirements.txt \ devscripts test @@ -1,23 +1,4 @@ -<!-- MANPAGE: BEGIN EXCLUDED SECTION --> -<div align="center"> - -[](#readme) - -[](#installation "Installation") -[](https://pypi.org/project/yt-dlp "PyPi") -[](Collaborators.md#collaborators "Donate") -[](https://matrix.to/#/#yt-dlp:matrix.org "Matrix") -[](https://discord.gg/H5MNcFW63r "Discord") -[](supportedsites.md "Supported Sites") -[](LICENSE "License") -[](https://github.com/yt-dlp/yt-dlp/actions "CI Status") -[](https://github.com/yt-dlp/yt-dlp/commits "Commit History") -[](https://github.com/yt-dlp/yt-dlp/pulse/monthly "Last activity") - -</div> -<!-- MANPAGE: END EXCLUDED SECTION --> - -yt-dlp is a [youtube-dl](https://github.com/ytdl-org/youtube-dl) fork based on the now inactive [youtube-dlc](https://github.com/blackjack4494/yt-dlc). The main focus of this project is adding new features and patches while also keeping up to date with the original project +hypervideo - A fork of yt-dlp without nonfree parts <!-- MANPAGE: MOVE "USAGE AND OPTIONS" SECTION HERE --> @@ -26,7 +7,6 @@ yt-dlp is a [youtube-dl](https://github.com/ytdl-org/youtube-dl) fork based on t * [Differences in default behavior](#differences-in-default-behavior) * [INSTALLATION](#installation) * [Detailed instructions](https://github.com/yt-dlp/yt-dlp/wiki/Installation) - * [Update](#update) * [Release Files](#release-files) * [Dependencies](#dependencies) * [Compile](#compile) @@ -130,16 +110,16 @@ Features marked with a **\*** have been back-ported to youtube-dl ### Differences in default behavior -Some of yt-dlp's default options are different from that of youtube-dl and youtube-dlc: +Some of hypervideo's default options are different from that of youtube-dl and youtube-dlc: * yt-dlp supports only [Python 3.7+](## "Windows 7"), and *may* remove support for more versions as they [become EOL](https://devguide.python.org/versions/#python-release-cycle); while [youtube-dl still supports Python 2.6+ and 3.2+](https://github.com/ytdl-org/youtube-dl/issues/30568#issue-1118238743) * The options `--auto-number` (`-A`), `--title` (`-t`) and `--literal` (`-l`), no longer work. See [removed options](#Removed) for details * `avconv` is not supported as an alternative to `ffmpeg` -* yt-dlp stores config files in slightly different locations to youtube-dl. See [CONFIGURATION](#configuration) for a list of correct locations -* The default [output template](#output-template) is `%(title)s [%(id)s].%(ext)s`. There is no real reason for this change. This was changed before yt-dlp was ever made public and now there are no plans to change it back to `%(title)s-%(id)s.%(ext)s`. Instead, you may use `--compat-options filename` +* hypervideo stores config files in slightly different locations to youtube-dl. See [CONFIGURATION](#configuration) for a list of correct locations +* The default [output template](#output-template) is `%(title)s [%(id)s].%(ext)s`. There is no real reason for this change. This was changed before hypervideo was ever made public and now there are no plans to change it back to `%(title)s-%(id)s.%(ext)s`. Instead, you may use `--compat-options filename` * The default [format sorting](#sorting-formats) is different from youtube-dl and prefers higher resolution and better codecs rather than higher bitrates. You can use the `--format-sort` option to change this to any order you prefer, or use `--compat-options format-sort` to use youtube-dl's sorting order * The default format selector is `bv*+ba/b`. This means that if a combined video + audio format that is better than the best video-only format is found, the former will be preferred. Use `-f bv+ba/b` or `--compat-options format-spec` to revert this -* Unlike youtube-dlc, yt-dlp does not allow merging multiple audio/video streams into one file by default (since this conflicts with the use of `-f bv*+ba`). If needed, this feature must be enabled using `--audio-multistreams` and `--video-multistreams`. You can also use `--compat-options multistreams` to enable both +* Unlike youtube-dlc, hypervideo does not allow merging multiple audio/video streams into one file by default (since this conflicts with the use of `-f bv*+ba`). If needed, this feature must be enabled using `--audio-multistreams` and `--video-multistreams`. You can also use `--compat-options multistreams` to enable both * `--no-abort-on-error` is enabled by default. Use `--abort-on-error` or `--compat-options abort-on-error` to abort on errors instead * When writing metadata files such as thumbnails, description or infojson, the same information (if available) is also written for playlists. Use `--no-write-playlist-metafiles` or `--compat-options no-playlist-metafiles` to not write these files * `--add-metadata` attaches the `infojson` to `mkv` files in addition to writing the metadata when used with `--write-info-json`. Use `--no-embed-info-json` or `--compat-options no-attach-info-json` to revert this @@ -170,106 +150,21 @@ For ease of use, a few more compat options are available: # INSTALLATION -<!-- MANPAGE: BEGIN EXCLUDED SECTION --> -[](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe) -[](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp) -[](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos) -[](https://pypi.org/project/yt-dlp) -[](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz) -[](#release-files) -[](https://github.com/yt-dlp/yt-dlp/releases) -<!-- MANPAGE: END EXCLUDED SECTION --> - -You can install yt-dlp using [the binaries](#release-files), [pip](https://pypi.org/project/yt-dlp) or one using a third-party package manager. See [the wiki](https://github.com/yt-dlp/yt-dlp/wiki/Installation) for detailed instructions - - -## UPDATE -You can use `yt-dlp -U` to update if you are using the [release binaries](#release-files) - -If you [installed with pip](https://github.com/yt-dlp/yt-dlp/wiki/Installation#with-pip), simply re-run the same command that was used to install the program - -For other third-party package managers, see [the wiki](https://github.com/yt-dlp/yt-dlp/wiki/Installation#third-party-package-managers) or refer their documentation - -<a id="update-channels"/> - -There are currently two release channels for binaries, `stable` and `nightly`. -`stable` is the default channel, and many of its changes have been tested by users of the nightly channel. -The `nightly` channel has releases built after each push to the master branch, and will have the most recent fixes and additions, but also have more risk of regressions. They are available in [their own repo](https://github.com/yt-dlp/yt-dlp-nightly-builds/releases). - -When using `--update`/`-U`, a release binary will only update to its current channel. -`--update-to CHANNEL` can be used to switch to a different channel when a newer version is available. `--update-to [CHANNEL@]TAG` can also be used to upgrade or downgrade to specific tags from a channel. - -You may also use `--update-to <repository>` (`<owner>/<repository>`) to update to a channel on a completely different repository. Be careful with what repository you are updating to though, there is no verification done for binaries from different repositories. - -Example usage: -* `yt-dlp --update-to nightly` change to `nightly` channel and update to its latest release -* `yt-dlp --update-to stable@2023.02.17` upgrade/downgrade to release to `stable` channel tag `2023.02.17` -* `yt-dlp --update-to 2023.01.06` upgrade/downgrade to tag `2023.01.06` if it exists on the current channel -* `yt-dlp --update-to example/yt-dlp@2023.03.01` upgrade/downgrade to the release from the `example/yt-dlp` repository, tag `2023.03.01` - -<!-- MANPAGE: BEGIN EXCLUDED SECTION --> -## RELEASE FILES - -#### Recommended - -File|Description -:---|:--- -[yt-dlp](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp)|Platform-independent [zipimport](https://docs.python.org/3/library/zipimport.html) binary. Needs Python (recommended for **Linux/BSD**) -[yt-dlp.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe)|Windows (Win7 SP1+) standalone x64 binary (recommended for **Windows**) -[yt-dlp_macos](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos)|Universal MacOS (10.15+) standalone executable (recommended for **MacOS**) - -#### Alternatives - -File|Description -:---|:--- -[yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Vista SP2+) standalone x86 (32-bit) binary -[yt-dlp_min.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_min.exe)|Windows (Win7 SP1+) standalone x64 binary built with `py2exe`<br/> ([Not recommended](#standalone-py2exe-builds-windows)) -[yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux standalone x64 binary -[yt-dlp_linux.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux.zip)|Unpackaged Linux executable (no auto-update) -[yt-dlp_linux_armv7l](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_armv7l)|Linux standalone armv7l (32-bit) binary -[yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux standalone aarch64 (64-bit) binary -[yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows executable (no auto-update) -[yt-dlp_macos.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos.zip)|Unpackaged MacOS (10.15+) executable (no auto-update) -[yt-dlp_macos_legacy](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos_legacy)|MacOS (10.9+) standalone x64 executable - -#### Misc - -File|Description -:---|:--- -[yt-dlp.tar.gz](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz)|Source tarball -[SHA2-512SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-512SUMS)|GNU-style SHA512 sums -[SHA2-512SUMS.sig](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-512SUMS.sig)|GPG signature file for SHA512 sums -[SHA2-256SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-256SUMS)|GNU-style SHA256 sums -[SHA2-256SUMS.sig](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-256SUMS.sig)|GPG signature file for SHA256 sums - -The public key that can be used to verify the GPG signatures is [available here](https://github.com/yt-dlp/yt-dlp/blob/master/public.key) -Example usage: -``` -curl -L https://github.com/yt-dlp/yt-dlp/raw/master/public.key | gpg --import -gpg --verify SHA2-256SUMS.sig SHA2-256SUMS -gpg --verify SHA2-512SUMS.sig SHA2-512SUMS +```console +# pacman -S hypervideo ``` -<!-- MANPAGE: END EXCLUDED SECTION --> - -**Note**: The manpages, shell completion (autocomplete) files etc. are available inside the [source tarball](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz) ## DEPENDENCIES Python versions 3.7+ (CPython and PyPy) are supported. Other versions and implementations may or may not work correctly. -<!-- Python 3.5+ uses VC++14 and it is already embedded in the binary created -<!x-- https://www.microsoft.com/en-us/download/details.aspx?id=26999 --x> -On windows, [Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)](https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe) is also necessary to run yt-dlp. You probably already have this, but if the executable throws an error due to missing `MSVCR100.dll` you need to install it manually. ---> - While all the other dependencies are optional, `ffmpeg` and `ffprobe` are highly recommended ### Strongly recommended * [**ffmpeg** and **ffprobe**](https://www.ffmpeg.org) - Required for [merging separate video and audio files](#format-selection) as well as for various [post-processing](#post-processing-options) tasks. License [depends on the build](https://www.ffmpeg.org/legal.html) - There are bugs in ffmpeg that causes various issues when used alongside yt-dlp. Since ffmpeg is such an important dependency, we provide [custom builds](https://github.com/yt-dlp/FFmpeg-Builds#ffmpeg-static-auto-builds) with patches for some of these issues at [yt-dlp/FFmpeg-Builds](https://github.com/yt-dlp/FFmpeg-Builds). See [the readme](https://github.com/yt-dlp/FFmpeg-Builds#patches-applied) for details on the specific issues solved by these builds - - **Important**: What you need is ffmpeg *binary*, **NOT** [the python package of the same name](https://pypi.org/project/ffmpeg) + <!-- TODO: ffmpeg has merged this patch. Remove this note once there is new release --> + **Note**: There are some regressions in newer ffmpeg versions that causes various issues when used alongside hypervideo. Since ffmpeg is such an important dependency, we provide [custom builds](https://github.com/yt-dlp/FFmpeg-Builds#ffmpeg-static-auto-builds) with patches for these issues at [yt-dlp/FFmpeg-Builds](https://github.com/yt-dlp/FFmpeg-Builds). See [the readme](https://github.com/yt-dlp/FFmpeg-Builds#patches-applied) for details on the specific issues solved by these builds ### Networking * [**certifi**](https://github.com/certifi/python-certifi)\* - Provides Mozilla's root certificate bundle. Licensed under [MPLv2](https://github.com/certifi/python-certifi/blob/master/LICENSE) @@ -300,13 +195,13 @@ To use or redistribute the dependencies, you must agree to their respective lice The standalone release binaries are built with the Python interpreter and the packages marked with **\*** included. -If you do not have the necessary dependencies for a task you are attempting, yt-dlp will warn you. All the currently available dependencies are visible at the top of the `--verbose` output +If you do not have the necessary dependencies for a task you are attempting, hypervideo will warn you. All the currently available dependencies are visible at the top of the `--verbose` output ## COMPILE ### Standalone PyInstaller Builds -To build the standalone executable, you must have Python and `pyinstaller` (plus any of yt-dlp's [optional dependencies](#dependencies) if needed). Once you have all the necessary dependencies installed, simply run `pyinst.py`. The executable will be built for the same architecture (x86/ARM, 32/64 bit) as the Python used. +To build the standalone executable, you must have Python and `pyinstaller` (plus any of hypervideo's [optional dependencies](#dependencies) if needed). Once you have all the necessary dependencies installed, simply run `pyinst.py`. The executable will be built for the same architecture (x86/ARM, 32/64 bit) as the Python used. python3 -m pip install -U pyinstaller -r requirements.txt python3 devscripts/make_lazy_extractors.py @@ -325,7 +220,7 @@ You will need the build tools `python` (3.7+), `zip`, `make` (GNU), `pandoc`\* a After installing these, simply run `make`. -You can also run `make yt-dlp` instead to compile only the binary without updating any of the additional files. (The build tools marked with **\*** are not needed for this) +You can also run `make hypervideo` instead to compile only the binary without updating any of the additional files. (The build tools marked with **\*** are not needed for this) ### Standalone Py2Exe Builds (Windows) @@ -339,9 +234,7 @@ If you wish to build it anyway, install Python and py2exe, and then simply run ` ### Related scripts -* **`devscripts/update-version.py`** - Update the version number based on current date. -* **`devscripts/set-variant.py`** - Set the build variant of the executable. -* **`devscripts/make_changelog.py`** - Create a markdown changelog using short commit messages and update `CONTRIBUTORS` file. +* **`devscripts/set-variant.py variant [-M update_message]`** - Set the build variant of the executable * **`devscripts/make_lazy_extractors.py`** - Create lazy extractors. Running this before building the binaries (any variant) will improve their startup performance. Set the environment variable `YTDLP_NO_LAZY_EXTRACTORS=1` if you wish to forcefully disable lazy extractor loading. Note: See their `--help` for more info. @@ -352,7 +245,7 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git # USAGE AND OPTIONS <!-- MANPAGE: BEGIN EXCLUDED SECTION --> - yt-dlp [OPTIONS] [--] URL [URL...] + hypervideo [OPTIONS] [--] URL [URL...] `Ctrl+F` is your friend :D <!-- MANPAGE: END EXCLUDED SECTION --> @@ -361,13 +254,6 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git ## General Options: -h, --help Print this help text and exit --version Print program version and exit - -U, --update Update this program to the latest version - --no-update Do not check for updates (default) - --update-to [CHANNEL]@[TAG] Upgrade/downgrade to a specific version. - CHANNEL can be a repository as well. CHANNEL - and TAG default to "stable" and "latest" - respectively if omitted; See "UPDATE" for - details. Supported channels: stable, nightly -i, --ignore-errors Ignore download and postprocessing errors. The download will be considered successful even if the postprocessing fails @@ -493,7 +379,7 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git --max-filesize SIZE Abort download if filesize is larger than SIZE, e.g. 50k or 44.6M --date DATE Download only videos uploaded on this date. - The date can be "YYYYMMDD" or in the format + The date can be "YYYYMMDD" or in the format [now|today|yesterday][-N[day|week|month|year]]. E.g. "--date today-2weeks" downloads only videos uploaded on the same day two weeks ago @@ -1148,35 +1034,29 @@ Make chapter entries for, or remove various segments (sponsor, # CONFIGURATION -You can configure yt-dlp by placing any supported command line option to a configuration file. The configuration is loaded from the following locations: +You can configure hypervideo by placing any supported command line option to a configuration file. The configuration is loaded from the following locations: 1. **Main Configuration**: * The file given by `--config-location` 1. **Portable Configuration**: (Recommended for portable installations) - * If using a binary, `yt-dlp.conf` in the same directory as the binary - * If running from source-code, `yt-dlp.conf` in the parent directory of `yt_dlp` + * If using a binary, `hypervideo.conf` in the same directory as the binary + * If running from source-code, `hypervideo.conf` in the parent directory of `hypervideo` 1. **Home Configuration**: - * `yt-dlp.conf` in the home path given by `-P` + * `hypervideo.conf` in the home path given by `-P` * If `-P` is not given, the current directory is searched 1. **User Configuration**: - * `${XDG_CONFIG_HOME}/yt-dlp.conf` - * `${XDG_CONFIG_HOME}/yt-dlp/config` (recommended on Linux/macOS) - * `${XDG_CONFIG_HOME}/yt-dlp/config.txt` - * `${APPDATA}/yt-dlp.conf` - * `${APPDATA}/yt-dlp/config` (recommended on Windows) - * `${APPDATA}/yt-dlp/config.txt` - * `~/yt-dlp.conf` - * `~/yt-dlp.conf.txt` - * `~/.yt-dlp/config` - * `~/.yt-dlp/config.txt` + * `${XDG_CONFIG_HOME}/hypervideo/config` (recommended on Linux/macOS) + * `${XDG_CONFIG_HOME}/hypervideo.conf` + * `${APPDATA}/hypervideo/config` (recommended on Windows) + * `${APPDATA}/hypervideo/config.txt` + * `~/hypervideo.conf` + * `~/hypervideo.conf.txt` See also: [Notes about environment variables](#notes-about-environment-variables) 1. **System Configuration**: - * `/etc/yt-dlp.conf` - * `/etc/yt-dlp/config` - * `/etc/yt-dlp/config.txt` + * `/etc/hypervideo.conf` -E.g. with the following configuration file yt-dlp will always extract the audio, not copy the mtime, use a proxy and save all videos under `YouTube` directory in your home directory: +E.g. with the following configuration file hypervideo will always extract the audio, not copy the mtime, use a proxy and save all videos under `YouTube` directory in your home directory: ``` # Lines starting with # are comments @@ -1195,7 +1075,7 @@ E.g. with the following configuration file yt-dlp will always extract the audio, **Note**: Options in configuration file are just the same options aka switches used in regular command line calls; thus there **must be no whitespace** after `-` or `--`, e.g. `-o` or `--proxy` but not `- o` or `-- proxy`. They must also be quoted when necessary as-if it were a UNIX shell. -You can use `--ignore-config` if you want to disable all configuration files for a particular yt-dlp run. If `--ignore-config` is found inside any configuration file, no further configuration will be loaded. For example, having the option in the portable configuration file prevents loading of home, user, and system configurations. Additionally, (for backward compatibility) if `--ignore-config` is found inside the system configuration file, the user configuration is not loaded. +You can use `--ignore-config` if you want to disable all configuration files for a particular hypervideo run. If `--ignore-config` is found inside any configuration file, no further configuration will be loaded. For example, having the option in the portable configuration file prevents loading of home, user, and system configurations. Additionally, (for backward compatibility) if `--ignore-config` is found inside the system configuration file, the user configuration is not loaded. ### Configuration file encoding @@ -1205,7 +1085,7 @@ If you want your file to be decoded differently, add `# coding: ENCODING` to the ### Authentication with netrc -You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every yt-dlp execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](https://stackoverflow.com/tags/.netrc/info) on a per-extractor basis. For that you will need to create a `.netrc` file in `--netrc-location` and restrict permissions to read/write by only you: +You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every hypervideo execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](https://stackoverflow.com/tags/.netrc/info) on a per-extractor basis. For that you will need to create a `.netrc` file in `--netrc-location` and restrict permissions to read/write by only you: ``` touch ${HOME}/.netrc chmod a-rwx,u+rw ${HOME}/.netrc @@ -1219,7 +1099,7 @@ E.g. machine youtube login myaccount@gmail.com password my_youtube_password machine twitch login my_twitch_account_name password my_twitch_password ``` -To activate authentication with the `.netrc` file you should pass `--netrc` to yt-dlp or place it in the [configuration file](#configuration). +To activate authentication with the `.netrc` file you should pass `--netrc` to hypervideo or place it in the [configuration file](#configuration). The default location of the .netrc file is `~` (see below). @@ -1233,7 +1113,7 @@ yt-dlp --netrc-cmd 'gpg --decrypt ~/.authinfo.gpg' https://www.youtube.com/watch ### Notes about environment variables * Environment variables are normally specified as `${VARIABLE}`/`$VARIABLE` on UNIX and `%VARIABLE%` on Windows; but is always shown as `${VARIABLE}` in this documentation -* yt-dlp also allow using UNIX-style variables on Windows for path-like options; e.g. `--output`, `--config-location` +* hypervideo also allow using UNIX-style variables on Windows for path-like options; e.g. `--output`, `--config-location` * If unset, `${XDG_CONFIG_HOME}` defaults to `~/.config` and `${XDG_CACHE_HOME}` to `~/.cache` * On Windows, `~` points to `${HOME}` if present; or, `${USERPROFILE}` or `${HOMEDRIVE}${HOMEPATH}` otherwise * On Windows, `${USERPROFILE}` generally points to `C:\Users\<user name>` and `${APPDATA}` to `${USERPROFILE}\AppData\Roaming` @@ -1246,7 +1126,7 @@ The `-o` option is used to indicate a template for the output file names while ` **tl;dr:** [navigate me to examples](#output-template-examples). <!-- MANPAGE: END EXCLUDED SECTION --> -The simplest usage of `-o` is not to set any template arguments when downloading a single file, like in `yt-dlp -o funny_video.flv "https://some/video"` (hard-coding file extension like this is _not_ recommended and could break some post-processing). +The simplest usage of `-o` is not to set any template arguments when downloading a single file, like in `hypervideo -o funny_video.flv "https://some/video"` (hard-coding file extension like this is _not_ recommended and could break some post-processing). It may however also contain special sequences that will be replaced when downloading each video. The special sequences may be formatted according to [Python string formatting operations](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting), e.g. `%(NAME)s` or `%(NAME)05d`. To clarify, that is a percent symbol followed by a name in parentheses, followed by formatting operations. @@ -1264,7 +1144,7 @@ The field names themselves (the part inside the parenthesis) can also have some 1. **Default**: A literal default value can be specified for when the field is empty using a `|` separator. This overrides `--output-na-placeholder`. E.g. `%(uploader|Unknown)s` -1. **More Conversions**: In addition to the normal format types `diouxXeEfFgGcrs`, yt-dlp additionally supports converting to `B` = **B**ytes, `j` = **j**son (flag `#` for pretty-printing, `+` for Unicode), `h` = HTML escaping, `l` = a comma separated **l**ist (flag `#` for `\n` newline-separated), `q` = a string **q**uoted for the terminal (flag `#` to split a list into different arguments), `D` = add **D**ecimal suffixes (e.g. 10M) (flag `#` to use 1024 as factor), and `S` = **S**anitize as filename (flag `#` for restricted) +1. **More Conversions**: In addition to the normal format types `diouxXeEfFgGcrs`, hypervideo additionally supports converting to `B` = **B**ytes, `j` = **j**son (flag `#` for pretty-printing, `+` for Unicode), `h` = HTML escaping, `l` = a comma separated **l**ist (flag `#` for `\n` newline-separated), `q` = a string **q**uoted for the terminal (flag `#` to split a list into different arguments), `D` = add **D**ecimal suffixes (e.g. 10M) (flag `#` to use 1024 as factor), and `S` = **S**anitize as filename (flag `#` for restricted) 1. **Unicode normalization**: The format type `U` can be used for NFC [Unicode normalization](https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize). The alternate form flag (`#`) changes the normalization to NFD and the conversion flag `+` can be used for NFKC/NFKD compatibility equivalence normalization. E.g. `%(title)+.100U` is NFKC @@ -1334,11 +1214,11 @@ The available fields are: - `playlist_autonumber` (numeric): Position of the video in the playlist download queue padded with leading zeros according to the total length of the playlist - `playlist_uploader` (string): Full name of the playlist uploader - `playlist_uploader_id` (string): Nickname or id of the playlist uploader - - `webpage_url` (string): A URL to the video webpage which if given to yt-dlp should allow to get the same result again + - `webpage_url` (string): A URL to the video webpage which if given to hypervideo should allow to get the same result again - `webpage_url_basename` (string): The basename of the webpage URL - `webpage_url_domain` (string): The domain of the webpage URL - `original_url` (string): The URL given by the user (or same as `webpage_url` for playlist entries) - + All the fields in [Filtering Formats](#filtering-formats) can also be used Available for the video that belongs to some logical chapter or section: @@ -1385,10 +1265,6 @@ Available only when used in `--print`: - `thumbnails_table` (table): The thumbnail format table as printed by `--list-thumbnails` - `subtitles_table` (table): The subtitle format table as printed by `--list-subs` - `automatic_captions_table` (table): The automatic subtitle format table as printed by `--list-subs` - - Available only after the video is downloaded (`post_process`/`after_move`): - - - `filepath`: Actual path of downloaded video file Available only in `--sponsorblock-chapter-title`: @@ -1400,7 +1276,7 @@ Available only in `--sponsorblock-chapter-title`: - `name` (string): Friendly name of the smallest category - `type` (string): The [SponsorBlock action type](https://wiki.sponsor.ajay.app/w/Types#Action_Type) of the chapter -Each aforementioned sequence when referenced in an output template will be replaced by the actual value corresponding to the sequence name. E.g. for `-o %(title)s-%(id)s.%(ext)s` and an mp4 video with title `yt-dlp test video` and id `BaW_jenozKc`, this will result in a `yt-dlp test video-BaW_jenozKc.mp4` file created in the current directory. +Each aforementioned sequence when referenced in an output template will be replaced by the actual value corresponding to the sequence name. E.g. for `-o %(title)s-%(id)s.%(ext)s` and an mp4 video with title `hypervideo test video` and id `BaW_jenozKc`, this will result in a `hypervideo test video-BaW_jenozKc.mp4` file created in the current directory. **Note**: Some of the sequences are not guaranteed to be present since they depend on the metadata obtained by a particular extractor. Such sequences will be replaced with placeholder value provided with `--output-na-placeholder` (`NA` by default). @@ -1419,50 +1295,50 @@ In some cases, you don't want special characters such as 中, spaces, or &, such #### Output template examples ```bash -$ yt-dlp --print filename -o "test video.%(ext)s" BaW_jenozKc +$ hypervideo --print filename -o "test video.%(ext)s" BaW_jenozKc test video.webm # Literal name with correct extension -$ yt-dlp --print filename -o "%(title)s.%(ext)s" BaW_jenozKc +$ hypervideo --print filename -o "%(title)s.%(ext)s" BaW_jenozKc youtube-dl test video ''_ä↭𝕐.webm # All kinds of weird characters -$ yt-dlp --print filename -o "%(title)s.%(ext)s" BaW_jenozKc --restrict-filenames +$ hypervideo --print filename -o "%(title)s.%(ext)s" BaW_jenozKc --restrict-filenames youtube-dl_test_video_.webm # Restricted file name # Download YouTube playlist videos in separate directory indexed by video order in a playlist -$ yt-dlp -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" +$ hypervideo -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" # Download YouTube playlist videos in separate directories according to their uploaded year -$ yt-dlp -o "%(upload_date>%Y)s/%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" +$ hypervideo -o "%(upload_date>%Y)s/%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" # Prefix playlist index with " - " separator, but only if it is available -$ yt-dlp -o "%(playlist_index&{} - |)s%(title)s.%(ext)s" BaW_jenozKc "https://www.youtube.com/user/TheLinuxFoundation/playlists" +$ hypervideo -o '%(playlist_index|)s%(playlist_index& - |)s%(title)s.%(ext)s' BaW_jenozKc "https://www.youtube.com/user/TheLinuxFoundation/playlists" # Download all playlists of YouTube channel/user keeping each playlist in separate directory: -$ yt-dlp -o "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/user/TheLinuxFoundation/playlists" +$ hypervideo -o "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/user/TheLinuxFoundation/playlists" # Download Udemy course keeping each chapter in separate directory under MyVideos directory in your home -$ yt-dlp -u user -p password -P "~/MyVideos" -o "%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s" "https://www.udemy.com/java-tutorial" +$ hypervideo -u user -p password -P "~/MyVideos" -o "%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s" "https://www.udemy.com/java-tutorial" # Download entire series season keeping each series and each season in separate directory under C:/MyVideos -$ yt-dlp -P "C:/MyVideos" -o "%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s" "https://videomore.ru/kino_v_detalayah/5_sezon/367617" +$ hypervideo -P "C:/MyVideos" -o "%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s" "https://videomore.ru/kino_v_detalayah/5_sezon/367617" # Download video as "C:\MyVideos\uploader\title.ext", subtitles as "C:\MyVideos\subs\uploader\title.ext" # and put all temporary files in "C:\MyVideos\tmp" -$ yt-dlp -P "C:/MyVideos" -P "temp:tmp" -P "subtitle:subs" -o "%(uploader)s/%(title)s.%(ext)s" BaW_jenoz --write-subs +$ hypervideo -P "C:/MyVideos" -P "temp:tmp" -P "subtitle:subs" -o "%(uploader)s/%(title)s.%(ext)s" BaW_jenoz --write-subs # Download video as "C:\MyVideos\uploader\title.ext" and subtitles as "C:\MyVideos\uploader\subs\title.ext" -$ yt-dlp -P "C:/MyVideos" -o "%(uploader)s/%(title)s.%(ext)s" -o "subtitle:%(uploader)s/subs/%(title)s.%(ext)s" BaW_jenozKc --write-subs +$ hypervideo -P "C:/MyVideos" -o "%(uploader)s/%(title)s.%(ext)s" -o "subtitle:%(uploader)s/subs/%(title)s.%(ext)s" BaW_jenozKc --write-subs # Stream the video being downloaded to stdout -$ yt-dlp -o - BaW_jenozKc +$ hypervideo -o - BaW_jenozKc ``` # FORMAT SELECTION -By default, yt-dlp tries to download the best available quality if you **don't** pass any options. -This is generally equivalent to using `-f bestvideo*+bestaudio/best`. However, if multiple audiostreams is enabled (`--audio-multistreams`), the default format changes to `-f bestvideo+bestaudio/best`. Similarly, if ffmpeg is unavailable, or if you use yt-dlp to stream to `stdout` (`-o -`), the default becomes `-f best/bestvideo+bestaudio`. +By default, hypervideo tries to download the best available quality if you **don't** pass any options. +This is generally equivalent to using `-f bestvideo*+bestaudio/best`. However, if multiple audiostreams is enabled (`--audio-multistreams`), the default format changes to `-f bestvideo+bestaudio/best`. Similarly, if ffmpeg is unavailable, or if you use hypervideo to stream to `stdout` (`-o -`), the default becomes `-f best/bestvideo+bestaudio`. -**Deprecation warning**: Latest versions of yt-dlp can stream multiple formats to the stdout simultaneously using ffmpeg. So, in future versions, the default for this will be set to `-f bv*+ba/b` similar to normal downloads. If you want to preserve the `-f b/bv+ba` setting, it is recommended to explicitly specify it in the configuration options. +**Deprecation warning**: Latest versions of hypervideo can stream multiple formats to the stdout simultaneously using ffmpeg. So, in future versions, the default for this will be set to `-f bv*+ba/b` similar to normal downloads. If you want to preserve the `-f b/bv+ba` setting, it is recommended to explicitly specify it in the configuration options. The general syntax for format selection is `-f FORMAT` (or `--format FORMAT`) where `FORMAT` is a *selector expression*, i.e. an expression that describes format or formats you would like to download. @@ -1582,7 +1458,7 @@ The available fields are: - `abr`: Average audio bitrate in KBit/s - `br`: Average bitrate in KBit/s, `tbr`/`vbr`/`abr` - `asr`: Audio sample rate in Hz - + **Deprecation warning**: Many of these fields have (currently undocumented) aliases, that may be removed in a future version. It is recommended to use only the documented field names. All fields, unless specified otherwise, are sorted in descending order. To reverse this, prefix the field with a `+`. E.g. `+res` prefers format with the smallest resolution. Additionally, you can suffix a preferred value for the fields, separated by a `:`. E.g. `res:720` prefers larger videos, but no larger than 720p and the smallest video if there are no videos less than 720p. For `codec` and `ext`, you can provide two preferred values, the first for video and the second for audio. E.g. `+codec:avc:m4a` (equivalent to `+vcodec:avc,+acodec:m4a`) sets the video codec preference to `h264` > `h265` > `vp9` > `vp9.2` > `av01` > `vp8` > `h263` > `theora` and audio codec preference to `mp4a` > `aac` > `vorbis` > `opus` > `mp3` > `ac3` > `dts`. You can also make the sorting prefer the nearest values to the provided by using `~` as the delimiter. E.g. `filesize~1G` prefers the format with filesize closest to 1 GiB. @@ -1600,102 +1476,102 @@ If your format selector is `worst`, the last item is selected after sorting. Thi ```bash # Download and merge the best video-only format and the best audio-only format, # or download the best combined format if video-only format is not available -$ yt-dlp -f "bv+ba/b" +$ hypervideo -f "bv+ba/b" # Download best format that contains video, # and if it doesn't already have an audio stream, merge it with best audio-only format -$ yt-dlp -f "bv*+ba/b" +$ hypervideo -f "bv*+ba/b" # Same as above -$ yt-dlp +$ hypervideo # Download the best video-only format and the best audio-only format without merging them # For this case, an output template should be used since # by default, bestvideo and bestaudio will have the same file name. -$ yt-dlp -f "bv,ba" -o "%(title)s.f%(format_id)s.%(ext)s" +$ hypervideo -f "bv,ba" -o "%(title)s.f%(format_id)s.%(ext)s" # Download and merge the best format that has a video stream, # and all audio-only formats into one file -$ yt-dlp -f "bv*+mergeall[vcodec=none]" --audio-multistreams +$ hypervideo -f "bv*+mergeall[vcodec=none]" --audio-multistreams # Download and merge the best format that has a video stream, # and the best 2 audio-only formats into one file -$ yt-dlp -f "bv*+ba+ba.2" --audio-multistreams +$ hypervideo -f "bv*+ba+ba.2" --audio-multistreams # The following examples show the old method (without -S) of format selection # and how to use -S to achieve a similar but (generally) better result # Download the worst video available (old method) -$ yt-dlp -f "wv*+wa/w" +$ hypervideo -f "wv*+wa/w" # Download the best video available but with the smallest resolution -$ yt-dlp -S "+res" +$ hypervideo -S "+res" # Download the smallest video available -$ yt-dlp -S "+size,+br" +$ hypervideo -S "+size,+br" # Download the best mp4 video available, or the best video if no mp4 available -$ yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" +$ hypervideo -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" # Download the best video with the best extension # (For video, mp4 > mov > webm > flv. For audio, m4a > aac > mp3 ...) -$ yt-dlp -S "ext" +$ hypervideo -S "ext" # Download the best video available but no better than 480p, # or the worst video if there is no video under 480p -$ yt-dlp -f "bv*[height<=480]+ba/b[height<=480] / wv*+ba/w" +$ hypervideo -f "bv*[height<=480]+ba/b[height<=480] / wv*+ba/w" # Download the best video available with the largest height but no better than 480p, # or the best video with the smallest resolution if there is no video under 480p -$ yt-dlp -S "height:480" +$ hypervideo -S "height:480" # Download the best video available with the largest resolution but no better than 480p, # or the best video with the smallest resolution if there is no video under 480p # Resolution is determined by using the smallest dimension. # So this works correctly for vertical videos as well -$ yt-dlp -S "res:480" +$ hypervideo -S "res:480" # Download the best video (that also has audio) but no bigger than 50 MB, # or the worst video (that also has audio) if there is no video under 50 MB -$ yt-dlp -f "b[filesize<50M] / w" +$ hypervideo -f "b[filesize<50M] / w" # Download largest video (that also has audio) but no bigger than 50 MB, # or the smallest video (that also has audio) if there is no video under 50 MB -$ yt-dlp -f "b" -S "filesize:50M" +$ hypervideo -f "b" -S "filesize:50M" # Download best video (that also has audio) that is closest in size to 50 MB -$ yt-dlp -f "b" -S "filesize~50M" +$ hypervideo -f "b" -S "filesize~50M" # Download best video available via direct link over HTTP/HTTPS protocol, # or the best video available via any protocol if there is no such video -$ yt-dlp -f "(bv*+ba/b)[protocol^=http][protocol!*=dash] / (bv*+ba/b)" +$ hypervideo -f "(bv*+ba/b)[protocol^=http][protocol!*=dash] / (bv*+ba/b)" # Download best video available via the best protocol # (https/ftps > http/ftp > m3u8_native > m3u8 > http_dash_segments ...) -$ yt-dlp -S "proto" +$ hypervideo -S "proto" # Download the best video with either h264 or h265 codec, # or the best video if there is no such video -$ yt-dlp -f "(bv*[vcodec~='^((he|a)vc|h26[45])']+ba) / (bv*+ba/b)" +$ hypervideo -f "(bv*[vcodec~='^((he|a)vc|h26[45])']+ba) / (bv*+ba/b)" # Download the best video with best codec no better than h264, # or the best video with worst codec if there is no such video -$ yt-dlp -S "codec:h264" +$ hypervideo -S "codec:h264" # Download the best video with worst codec no worse than h264, # or the best video with best codec if there is no such video -$ yt-dlp -S "+codec:h264" +$ hypervideo -S "+codec:h264" @@ -1703,19 +1579,19 @@ $ yt-dlp -S "+codec:h264" # Download the best video no better than 720p preferring framerate greater than 30, # or the worst video (still preferring framerate greater than 30) if there is no such video -$ yt-dlp -f "((bv*[fps>30]/bv*)[height<=720]/(wv*[fps>30]/wv*)) + ba / (b[fps>30]/b)[height<=720]/(w[fps>30]/w)" +$ hypervideo -f "((bv*[fps>30]/bv*)[height<=720]/(wv*[fps>30]/wv*)) + ba / (b[fps>30]/b)[height<=720]/(w[fps>30]/w)" # Download the video with the largest resolution no better than 720p, # or the video with the smallest resolution available if there is no such video, # preferring larger framerate for formats with the same resolution -$ yt-dlp -S "res:720,fps" +$ hypervideo -S "res:720,fps" # Download the video with smallest resolution no worse than 480p, # or the video with the largest resolution available if there is no such video, # preferring better codec and then larger total bitrate for the same resolution -$ yt-dlp -S "+res:480,codec,br" +$ hypervideo -S "+res:480,codec,br" ``` # MODIFYING METADATA @@ -1736,7 +1612,7 @@ This option also has a few special uses: **Note**: Metadata modification happens before format selection, post-extraction and other post-processing operations. Some fields may be added or changed during these steps, overriding your changes. -For reference, these are the fields yt-dlp adds by default to the file metadata: +For reference, these are the fields hypervideo adds by default to the file metadata: Metadata fields | From :--------------------------|:------------------------------------------------ @@ -1763,29 +1639,29 @@ Metadata fields | From ```bash # Interpret the title as "Artist - Title" -$ yt-dlp --parse-metadata "title:%(artist)s - %(title)s" +$ hypervideo --parse-metadata "title:%(artist)s - %(title)s" # Regex example -$ yt-dlp --parse-metadata "description:Artist - (?P<artist>.+)" +$ hypervideo --parse-metadata "description:Artist - (?P<artist>.+)" # Set title as "Series name S01E05" -$ yt-dlp --parse-metadata "%(series)s S%(season_number)02dE%(episode_number)02d:%(title)s" +$ hypervideo --parse-metadata "%(series)s S%(season_number)02dE%(episode_number)02d:%(title)s" # Prioritize uploader as the "artist" field in video metadata -$ yt-dlp --parse-metadata "%(uploader|)s:%(meta_artist)s" --embed-metadata +$ hypervideo --parse-metadata "%(uploader|)s:%(meta_artist)s" --embed-metadata # Set "comment" field in video metadata using description instead of webpage_url, # handling multiple lines correctly -$ yt-dlp --parse-metadata "description:(?s)(?P<meta_comment>.+)" --embed-metadata +$ hypervideo --parse-metadata "description:(?s)(?P<meta_comment>.+)" --embed-metadata # Do not set any "synopsis" in the video metadata -$ yt-dlp --parse-metadata ":(?P<meta_synopsis>)" +$ hypervideo --parse-metadata ":(?P<meta_synopsis>)" # Remove "formats" field from the infojson by setting it to an empty string -$ yt-dlp --parse-metadata "video::(?P<formats>)" --write-info-json +$ hypervideo --parse-metadata ":(?P<formats>)" -j # Replace all spaces and "_" in title and uploader with a `-` -$ yt-dlp --replace-in-metadata "title,uploader" "[ _]" "-" +$ hypervideo --replace-in-metadata "title,uploader" "[ _]" "-" ``` @@ -1872,10 +1748,10 @@ The following extractors use this feature: # PLUGINS -Note that **all** plugins are imported even if not invoked, and that **there are no checks** performed on plugin code. **Use plugins at your own risk and only if you trust the code!** +Plugins are loaded from `<root-dir>/ytdlp_plugins/<type>/__init__.py`; where `<root-dir>` is the directory of the binary (`<root-dir>/hypervideo`), or the root directory of the module if you are running directly from source-code (`<root dir>/hypervideo_dl/__main__.py`). Plugins are currently not supported for the `pip` version -Plugins can be of `<type>`s `extractor` or `postprocessor`. -- Extractor plugins do not need to be enabled from the CLI and are automatically invoked when the input URL is suitable for it. +Plugins can be of `<type>`s `extractor` or `postprocessor`. +- Extractor plugins do not need to be enabled from the CLI and are automatically invoked when the input URL is suitable for it. - Extractor plugins take priority over builtin extractors. - Postprocessor plugins can be invoked using `--use-postprocessor NAME`. @@ -1883,7 +1759,7 @@ Plugins can be of `<type>`s `extractor` or `postprocessor`. Plugins are loaded from the namespace packages `yt_dlp_plugins.extractor` and `yt_dlp_plugins.postprocessor`. In other words, the file structure on the disk looks something like: - + yt_dlp_plugins/ extractor/ myplugin.py @@ -1938,25 +1814,25 @@ If you are a plugin author, add [yt-dlp-plugins](https://github.com/topics/yt-dl See the [Developer Instructions](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#developer-instructions) on how to write and test an extractor. -# EMBEDDING YT-DLP +# EMBEDDING HYPERVIDEO -yt-dlp makes the best effort to be a good command-line program, and thus should be callable from any programming language. +hypervideo makes the best effort to be a good command-line program, and thus should be callable from any programming language. Your program should avoid parsing the normal stdout since they may change in future versions. Instead they should use options such as `-J`, `--print`, `--progress-template`, `--exec` etc to create console output that you can reliably reproduce and parse. -From a Python program, you can embed yt-dlp in a more powerful fashion, like this: +From a Python program, you can embed hypervideo in a more powerful fashion, like this: ```python -from yt_dlp import YoutubeDL +from hypervideo_dl import YoutubeDL URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] with YoutubeDL() as ydl: ydl.download(URLS) ``` -Most likely, you'll want to use various options. For a list of options available, have a look at [`yt_dlp/YoutubeDL.py`](yt_dlp/YoutubeDL.py#L183) or `help(yt_dlp.YoutubeDL)` in a Python shell. If you are already familiar with the CLI, you can use [`devscripts/cli_to_api.py`](https://github.com/yt-dlp/yt-dlp/blob/master/devscripts/cli_to_api.py) to translate any CLI switches to `YoutubeDL` params. +Most likely, you'll want to use various options. For a list of options available, have a look at [`hypervideo_dl/YoutubeDL.py`](hypervideo_dl/YoutubeDL.py#L180). -**Tip**: If you are porting your code from youtube-dl to yt-dlp, one important point to look out for is that we do not guarantee the return value of `YoutubeDL.extract_info` to be json serializable, or even be a dictionary. It will be dictionary-like, but if you want to ensure it is a serializable dictionary, pass it through `YoutubeDL.sanitize_info` as shown in the [example below](#extracting-information) +**Tip**: If you are porting your code from youtube-dl to hypervideo, one important point to look out for is that we do not guarantee the return value of `YoutubeDL.extract_info` to be json serializable, or even be a dictionary. It will be dictionary-like, but if you want to ensure it is a serializable dictionary, pass it through `YoutubeDL.sanitize_info` as shown in the [example below](#extracting-information) ## Embedding examples @@ -1964,13 +1840,13 @@ Most likely, you'll want to use various options. For a list of options available ```python import json -import yt_dlp +import hypervideo_dl URL = 'https://www.youtube.com/watch?v=BaW_jenozKc' -# ℹ️ See help(yt_dlp.YoutubeDL) for a list of available options and public functions +# ℹ️ See help(hypervideo_dl.YoutubeDL) for a list of available options and public functions ydl_opts = {} -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: info = ydl.extract_info(URL, download=False) # ℹ️ ydl.sanitize_info makes the info json-serializable @@ -1979,11 +1855,11 @@ with yt_dlp.YoutubeDL(ydl_opts) as ydl: #### Download using an info-json ```python -import yt_dlp +import hypervideo_dl INFO_FILE = 'path/to/video.info.json' -with yt_dlp.YoutubeDL() as ydl: +with hypervideo_dl.YoutubeDL() as ydl: error_code = ydl.download_with_info_file(INFO_FILE) print('Some videos failed to download' if error_code @@ -1993,27 +1869,27 @@ print('Some videos failed to download' if error_code #### Extract audio ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] ydl_opts = { 'format': 'm4a/bestaudio/best', - # ℹ️ See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments + # ℹ️ See help(hypervideo_dl.postprocessor) for a list of available Postprocessors and their arguments 'postprocessors': [{ # Extract audio using ffmpeg 'key': 'FFmpegExtractAudio', 'preferredcodec': 'm4a', }] } -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: error_code = ydl.download(URLS) ``` #### Filter videos ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] @@ -2027,14 +1903,14 @@ ydl_opts = { 'match_filter': longer_than_a_minute, } -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: error_code = ydl.download(URLS) ``` #### Adding logger and progress hook ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] @@ -2057,7 +1933,7 @@ class MyLogger: print(msg) -# ℹ️ See "progress_hooks" in help(yt_dlp.YoutubeDL) +# ℹ️ See "progress_hooks" in help(hypervideo_dl.YoutubeDL) def my_hook(d): if d['status'] == 'finished': print('Done downloading, now post-processing ...') @@ -2068,26 +1944,26 @@ ydl_opts = { 'progress_hooks': [my_hook], } -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(URLS) ``` #### Add a custom PostProcessor ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] -# ℹ️ See help(yt_dlp.postprocessor.PostProcessor) -class MyCustomPP(yt_dlp.postprocessor.PostProcessor): +# ℹ️ See help(hypervideo_dl.postprocessor.PostProcessor) +class MyCustomPP(hypervideo_dl.postprocessor.PostProcessor): def run(self, info): self.to_screen('Doing stuff') return [], info -with yt_dlp.YoutubeDL() as ydl: - # ℹ️ "when" can take any value in yt_dlp.utils.POSTPROCESS_WHEN +with hypervideo_dl.YoutubeDL() as ydl: + # ℹ️ "when" can take any value in hypervideo_dl.utils.POSTPROCESS_WHEN ydl.add_post_processor(MyCustomPP(), when='pre_process') ydl.download(URLS) ``` @@ -2096,7 +1972,7 @@ with yt_dlp.YoutubeDL() as ydl: #### Use a custom format selector ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] @@ -2131,7 +2007,7 @@ ydl_opts = { 'format': format_selector, } -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(URLS) ``` @@ -2247,7 +2123,7 @@ Support for [SponSkrub](https://github.com/faissaloo/SponSkrub) has been depreca #### No longer supported These options may no longer work as intended - --prefer-avconv avconv is not officially supported by yt-dlp (Alias: --no-prefer-ffmpeg) + --prefer-avconv avconv is not officially supported by hypervideo (Alias: --no-prefer-ffmpeg) --prefer-ffmpeg Default (Alias: --no-prefer-avconv) -C, --call-home Not implemented --no-call-home Default diff --git a/bin/yt-dlp b/bin/yt-dlp new file mode 100644 index 000000000..baecdeb0a --- /dev/null +++ b/bin/yt-dlp @@ -0,0 +1,6 @@ +#!/usr/bin/python + +import hypervideo_dl + +if __name__ == '__main__': + hypervideo_dl.main() diff --git a/build.sh b/build.sh new file mode 100644 index 000000000..fb4a608fe --- /dev/null +++ b/build.sh @@ -0,0 +1,99 @@ +#!/bin/bash + +# ============================================================================== +# FUNCTIONS - START +# ============================================================================== +VERSION='1.1.13' +BASEDIR="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" + +run_rebrand() +{ + printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Rebrand...' '\e[m' + + mv -T yt_dlp hypervideo_dl + mv bin/yt-dlp bin/hypervideo + + find . -type f \( \ + -iname "*" \ + ! -iname "build.sh" \ + ! -iname ".travis.yml" \ + ! -iname ".gitlab-ci.yml" \ + ! -path "./.git*" \) \ + -exec grep -rIl 'yt_dlp' {} + -exec sed -i 's|yt_dlp|hypervideo_dl|g' {} \; + + find . -name "setup.cfg" -type f -exec sed -i 's|yt-dlp|hypervideo|g' {} \; + find . -name "Makefile" -type f -exec sed -i 's|yt-dlp|hypervideo|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|yt-dlp|hypervideo|g' {} \; + find . -name "*.in" -type f -exec sed -i 's|yt-dlp|hypervideo|g' {} \; + + # fixes URLs + find . -name "*.py" -type f -exec sed -i 's|hypervideo+test+video|yt-dlp+test+video|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|https://github.com/ytdl-org/hypervideo/|https://github.com/ytdl-org/yt-dlp/|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|https://github.com/rg3/hypervideo/issues/|https://github.com/rg3/yt-dlp/issues/|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|http://hypervideo.bandcamp.com/|http://yt-dlp.bandcamp.com/|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|http://yt-dlp.bandcamp.com/track/hypervideo-test-song|http://yt-dlp.bandcamp.com/track/yt-dlp-test-song|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|https://www.dropbox.com/s/nelirfsxnmcfbfh/hypervideo|https://www.dropbox.com/s/nelirfsxnmcfbfh/yt-dlp|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|http://8tracks.com/ytdl/hypervideo-test-tracks-a|http://8tracks.com/ytdl/yt-dlp-test-tracks-a|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|http://phihag.de/2014/hypervideo/|http://phihag.de/2014/yt-dlp/|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|https://hypervideo-demo.neocities.org/|https://yt-dlp-demo.neocities.org/|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|https://travis-ci.org/ytdl-org/hypervideo/|https://travis-ci.org/ytdl-org/yt-dlp/|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|https://soundcloud.com/jaimemf/hypervideo-test|https://soundcloud.com/jaimemf/yt-dlp-test|g' {} \; + find . -name "*.py" -type f -exec sed -i 's|http://streamcloud.eu/skp9j99s4bpz/hypervideo_test_video|http://streamcloud.eu/skp9j99s4bpz/yt_dlp_test_video|g' {} \; + + find . -type f \( \ + -iname "*" \ + ! -iname "build.sh" \ + ! -iname ".travis.yml" \ + ! -iname ".gitlab-ci.yml" \ + ! -path "./.git*" \) \ + -exec grep -rIl 'YT-DLP' {} + -exec sed -i 's|YT-DLP|HYPERVIDEO|g' {} \; + + # Set current version + sed -i "s|__version.*|__version__ = '${VERSION}'|" hypervideo_dl/version.py +} + +run_clean() +{ + printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Clean tempfiles...' '\e[m' + rm -rf -- hypervideo.1.temp.md hypervideo.1 hypervideo.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ hypervideo.tar.gz hypervideo_dl/extractor/lazy_extractors.py *.dump *.part* *.ytdl *.info.json *.mp4 *.m4a *.flv *.mp3 *.avi *.mkv *.webm *.3gp *.wav *.ape *.swf *.jpg *.png CONTRIBUTING.md.tmp hypervideo hypervideo.exe + find . -name "*.pyc" -delete + find . -name "*.class" -delete +} + +run_make() +{ + printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Making hypervideo...' '\e[m' + make hypervideo.tar.gz +} + +run_copy() +{ + printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Genering build...' '\e[m' + install -d -m755 build + mv hypervideo.tar.gz "./build/hypervideo.tar.gz" + cd build && tar xzf hypervideo.tar.gz && + mv hypervideo "hypervideo-${VERSION}" && + tar -czvf "hypervideo-${VERSION}.tar.gz" "hypervideo-${VERSION}" && + rm -rf "hypervideo-${VERSION}" hypervideo.tar.gz + cd "$BASEDIR" || return + printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Tarball in build/ directory' '\e[m' +} + +# Restore directory, compatibility reasons +run_reset() +{ + printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Restore compatibility...' '\e[m' + mv -T hypervideo_dl yt_dlp + mv bin/hypervideo bin/yt-dlp + rm -v hypervideo + printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Please execute: "git checkout ." for complete restore' '\e[m' +} + +# ============================================================================== +# EXECUTION - START +# ============================================================================== +run_rebrand "$@" && run_clean "$@" + +run_make "$@" + +run_copy "$@" && run_reset "$@" diff --git a/devscripts/make_contributing.py b/devscripts/make_contributing.py index a06f8a616..d74462a3c 100755 --- a/devscripts/make_contributing.py +++ b/devscripts/make_contributing.py @@ -20,7 +20,7 @@ def main(): bug_text = re.search( r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1) dev_text = re.search( - r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING yt-dlp', readme).group(1) + r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING YT-DLP', readme).group(1) out = bug_text + dev_text diff --git a/devscripts/make_issue_template.py b/devscripts/make_issue_template.py deleted file mode 100644 index 39b95c8da..000000000 --- a/devscripts/make_issue_template.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python3 - -# Allow direct execution -import os -import sys - -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - - -import re - -from devscripts.utils import ( - get_filename_args, - read_file, - read_version, - write_file, -) - -VERBOSE_TMPL = ''' - - type: checkboxes - id: verbose - attributes: - label: Provide verbose output that clearly demonstrates the problem - options: - - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`) - required: true - - label: "If using API, add `'verbose': True` to `YoutubeDL` params instead" - required: false - - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below - required: true - - type: textarea - id: log - attributes: - label: Complete Verbose Output - description: | - It should start like this: - placeholder: | - [debug] Command-line config: ['-vU', 'test:youtube'] - [debug] Portable config "yt-dlp.conf": ['-i'] - [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8 - [debug] yt-dlp version %(version)s [9d339c4] (win32_exe) - [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0 - [debug] Checking exe version: ffmpeg -bsfs - [debug] Checking exe version: ffprobe -bsfs - [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1 - [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3 - [debug] Proxy map: {} - [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest - Latest version: %(version)s, Current version: %(version)s - yt-dlp is up to date (%(version)s) - <more lines> - render: shell - validations: - required: true -'''.strip() - -NO_SKIP = ''' - - type: checkboxes - attributes: - label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE - description: Fill all fields even if you think it is irrelevant for the issue - options: - - label: I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\\* field - required: true -'''.strip() - - -def main(): - fields = {'version': read_version(), 'no_skip': NO_SKIP} - fields['verbose'] = VERBOSE_TMPL % fields - fields['verbose_optional'] = re.sub(r'(\n\s+validations:)?\n\s+required: true', '', fields['verbose']) - - infile, outfile = get_filename_args(has_infile=True) - write_file(outfile, read_file(infile) % fields) - - -if __name__ == '__main__': - main() diff --git a/devscripts/make_readme.py b/devscripts/make_readme.py index 2270b31d3..2270b31d3 100755..100644 --- a/devscripts/make_readme.py +++ b/devscripts/make_readme.py diff --git a/devscripts/prepare_manpage.py b/devscripts/prepare_manpage.py index 9b12e71e5..a393d33e1 100644 --- a/devscripts/prepare_manpage.py +++ b/devscripts/prepare_manpage.py @@ -20,7 +20,7 @@ from devscripts.utils import ( ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) README_FILE = os.path.join(ROOT_DIR, 'README.md') -PREFIX = r'''%yt-dlp(1) +PREFIX = r'''%YT-DLP(1) # NAME diff --git a/devscripts/update-formulae.py b/devscripts/update-formulae.py deleted file mode 100644 index e79297f53..000000000 --- a/devscripts/update-formulae.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 - -""" -Usage: python3 ./devscripts/update-formulae.py <path-to-formulae-rb> <version> -version can be either 0-aligned (yt-dlp version) or normalized (PyPi version) -""" - -# Allow direct execution -import os -import sys - -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - - -import json -import re -import urllib.request - -from devscripts.utils import read_file, write_file - -filename, version = sys.argv[1:] - -normalized_version = '.'.join(str(int(x)) for x in version.split('.')) - -pypi_release = json.loads(urllib.request.urlopen( - 'https://pypi.org/pypi/yt-dlp/%s/json' % normalized_version -).read().decode()) - -tarball_file = next(x for x in pypi_release['urls'] if x['filename'].endswith('.tar.gz')) - -sha256sum = tarball_file['digests']['sha256'] -url = tarball_file['url'] - -formulae_text = read_file(filename) - -formulae_text = re.sub(r'sha256 "[0-9a-f]*?"', 'sha256 "%s"' % sha256sum, formulae_text, count=1) -formulae_text = re.sub(r'url "[^"]*?"', 'url "%s"' % url, formulae_text, count=1) - -write_file(filename, formulae_text) diff --git a/devscripts/update-version.py b/devscripts/update-version.py deleted file mode 100644 index c873d10a5..000000000 --- a/devscripts/update-version.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 - -# Allow direct execution -import os -import sys - -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - - -import argparse -import contextlib -import sys -from datetime import datetime - -from devscripts.utils import read_version, run_process, write_file - - -def get_new_version(version, revision): - if not version: - version = datetime.utcnow().strftime('%Y.%m.%d') - - if revision: - assert revision.isdigit(), 'Revision must be a number' - else: - old_version = read_version().split('.') - if version.split('.') == old_version[:3]: - revision = str(int((old_version + [0])[3]) + 1) - - return f'{version}.{revision}' if revision else version - - -def get_git_head(): - with contextlib.suppress(Exception): - return run_process('git', 'rev-parse', 'HEAD').stdout.strip() - - -VERSION_TEMPLATE = '''\ -# Autogenerated by devscripts/update-version.py - -__version__ = {version!r} - -RELEASE_GIT_HEAD = {git_head!r} - -VARIANT = None - -UPDATE_HINT = None - -CHANNEL = {channel!r} -''' - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Update the version.py file') - parser.add_argument( - '-c', '--channel', default='stable', - help='Select update channel (default: %(default)s)') - parser.add_argument( - '-o', '--output', default='yt_dlp/version.py', - help='The output file to write to (default: %(default)s)') - parser.add_argument( - 'version', nargs='?', default=None, - help='A version or revision to use instead of generating one') - args = parser.parse_args() - - git_head = get_git_head() - version = ( - args.version if args.version and '.' in args.version - else get_new_version(None, args.version)) - write_file(args.output, VERSION_TEMPLATE.format( - version=version, git_head=git_head, channel=args.channel)) - - print(f'version={version} ({args.channel}), head={git_head}') diff --git a/requirements.txt b/requirements.txt index dde37120f..9d3b70316 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ mutagen -pycryptodomex +pycryptodome websockets brotli; platform_python_implementation=='CPython' brotlicffi; platform_python_implementation!='CPython' @@ -6,57 +6,46 @@ import sys sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) -import subprocess import warnings +import sys try: - from setuptools import Command, find_packages, setup + from setuptools import setup, Command, find_packages setuptools_available = True except ImportError: - from distutils.core import Command, setup + from distutils.core import setup, Command setuptools_available = False +from distutils.spawn import spawn -from devscripts.utils import read_file, read_version +# Get the version from yt_dlp/version.py without importing the package +exec(compile(open('yt_dlp/version.py').read(), 'yt_dlp/version.py', 'exec')) -VERSION = read_version() DESCRIPTION = 'A youtube-dl fork with additional features and patches' LONG_DESCRIPTION = '\n\n'.join(( 'Official repository: <https://github.com/yt-dlp/yt-dlp>', '**PS**: Some links in this document will not work since this is a copy of the README.md from Github', - read_file('README.md'))) - -REQUIREMENTS = read_file('requirements.txt').splitlines() + open('README.md', encoding='utf-8').read())) +REQUIREMENTS = ['mutagen', 'pycryptodome', 'websockets'] -def packages(): - if setuptools_available: - return find_packages(exclude=('youtube_dl', 'youtube_dlc', 'test', 'ytdlp_plugins', 'devscripts')) - return [ - 'yt_dlp', 'yt_dlp.extractor', 'yt_dlp.downloader', 'yt_dlp.postprocessor', 'yt_dlp.compat', - ] - - -def py2exe_params(): +if sys.argv[1:2] == ['py2exe']: + import py2exe # noqa: F401 warnings.warn( 'py2exe builds do not support pycryptodomex and needs VC++14 to run. ' - 'It is recommended to run "pyinst.py" to build using pyinstaller instead') - - return { + 'The recommended way is to use "pyinst.py" to build using pyinstaller') + params = { 'console': [{ 'script': './yt_dlp/__main__.py', 'dest_base': 'yt-dlp', - 'icon_resources': [(1, 'devscripts/logo.ico')], - }], - 'version_info': { - 'version': VERSION, + 'version': __version__, 'description': DESCRIPTION, 'comments': LONG_DESCRIPTION.split('\n')[0], 'product_name': 'yt-dlp', - 'product_version': VERSION, - }, + 'product_version': __version__, + }], 'options': { 'bundle_files': 0, 'compressed': 1, @@ -68,11 +57,10 @@ def py2exe_params(): 'includes': ['yt_dlp.compat._legacy', 'yt_dlp.compat._deprecated', 'yt_dlp.utils._legacy', 'yt_dlp.utils._deprecated'], }, - 'zipfile': None, + 'zipfile': None } - -def build_params(): +else: files_spec = [ ('share/bash-completion/completions', ['completions/bash/yt-dlp']), ('share/zsh/site-functions', ['completions/zsh/_yt-dlp']), @@ -80,17 +68,20 @@ def build_params(): ('share/doc/yt_dlp', ['README.txt']), ('share/man/man1', ['yt-dlp.1']) ] + root = os.path.dirname(os.path.abspath(__file__)) data_files = [] for dirname, files in files_spec: resfiles = [] for fn in files: if not os.path.exists(fn): - warnings.warn(f'Skipping file {fn} since it is not present. Try running " make pypi-files " first') + warnings.warn('Skipping file %s since it is not present. Try running `make pypi-files` first' % fn) else: resfiles.append(fn) data_files.append((dirname, resfiles)) - params = {'data_files': data_files} + params = { + 'data_files': data_files, + } if setuptools_available: params['entry_points'] = { @@ -99,7 +90,6 @@ def build_params(): } else: params['scripts'] = ['yt-dlp'] - return params class build_lazy_extractors(Command): @@ -113,64 +103,47 @@ class build_lazy_extractors(Command): pass def run(self): - if self.dry_run: - print('Skipping build of lazy extractors in dry run mode') - return - subprocess.run([sys.executable, 'devscripts/make_lazy_extractors.py']) - - -def main(): - if sys.argv[1:2] == ['py2exe']: - params = py2exe_params() - try: - from py2exe import freeze - except ImportError: - import py2exe # noqa: F401 - warnings.warn('You are using an outdated version of py2exe. Support for this version will be removed in the future') - params['console'][0].update(params.pop('version_info')) - params['options'] = {'py2exe': params.pop('options')} - else: - return freeze(**params) - else: - params = build_params() - - setup( - name='yt-dlp', - version=VERSION, - maintainer='pukkandan', - maintainer_email='pukkandan.ytdlp@gmail.com', - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - long_description_content_type='text/markdown', - url='https://github.com/yt-dlp/yt-dlp', - packages=packages(), - install_requires=REQUIREMENTS, - python_requires='>=3.7', - project_urls={ - 'Documentation': 'https://github.com/yt-dlp/yt-dlp#readme', - 'Source': 'https://github.com/yt-dlp/yt-dlp', - 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues', - 'Funding': 'https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators', - }, - classifiers=[ - 'Topic :: Multimedia :: Video', - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: Implementation', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'License :: Public Domain', - 'Operating System :: OS Independent', - ], - cmdclass={'build_lazy_extractors': build_lazy_extractors}, - **params - ) - - -main() + spawn([sys.executable, 'devscripts/make_lazy_extractors.py', 'yt_dlp/extractor/lazy_extractors.py'], + dry_run=self.dry_run) + + +if setuptools_available: + packages = find_packages(exclude=('youtube_dl', 'youtube_dlc', 'test', 'ytdlp_plugins')) +else: + packages = ['yt_dlp', 'yt_dlp.downloader', 'yt_dlp.extractor', 'yt_dlp.postprocessor'] + + +setup( + name='yt-dlp', + version=__version__, + maintainer='Jesús E..', + maintainer_email='heckyel@hyperbola.info', + license='CC0-1.0', + description=DESCRIPTION, + long_description=LONG_DESCRIPTION, + long_description_content_type='text/markdown', + url='https://git.conocimientoslibres.ga/software/hypervideo.git', + packages=packages, + install_requires=REQUIREMENTS, + classifiers=[ + 'Topic :: Multimedia :: Video', + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: Implementation', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', + 'License :: Public Domain', + 'Operating System :: OS Independent', + ], + python_requires='>=3.6', + + cmdclass={'build_lazy_extractors': build_lazy_extractors}, + **params +) diff --git a/test/test_iqiyi_sdk_interpreter.py b/test/test_iqiyi_sdk_interpreter.py deleted file mode 100644 index 47c632a4e..000000000 --- a/test/test_iqiyi_sdk_interpreter.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 - -# Allow direct execution -import os -import sys -import unittest - -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - - -from test.helper import FakeYDL, is_download_test -from yt_dlp.extractor import IqiyiIE - - -class WarningLogger: - def __init__(self): - self.messages = [] - - def warning(self, msg): - self.messages.append(msg) - - def debug(self, msg): - pass - - def error(self, msg): - pass - - -@is_download_test -class TestIqiyiSDKInterpreter(unittest.TestCase): - def test_iqiyi_sdk_interpreter(self): - ''' - Test the functionality of IqiyiSDKInterpreter by trying to log in - - If `sign` is incorrect, /validate call throws an HTTP 556 error - ''' - logger = WarningLogger() - ie = IqiyiIE(FakeYDL({'logger': logger})) - ie._perform_login('foo', 'bar') - self.assertTrue('unable to log in:' in logger.messages[0]) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update.py.disabled b/test/test_update.py.disabled deleted file mode 100644 index 85ac86692..000000000 --- a/test/test_update.py.disabled +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python3 - -# Allow direct execution -import os -import sys -import unittest - -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - - -import json - -from yt_dlp.update import rsa_verify - - -class TestUpdate(unittest.TestCase): - def test_rsa_verify(self): - UPDATES_RSA_KEY = (0x9d60ee4d8f805312fdb15a62f87b95bd66177b91df176765d13514a0f1754bcd2057295c5b6f1d35daa6742c3ffc9a82d3e118861c207995a8031e151d863c9927e304576bc80692bc8e094896fcf11b66f3e29e04e3a71e9a11558558acea1840aec37fc396fb6b65dc81a1c4144e03bd1c011de62e3f1357b327d08426fe93, 65537) - with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'versions.json'), 'rb') as f: - versions_info = f.read().decode() - versions_info = json.loads(versions_info) - signature = versions_info['signature'] - del versions_info['signature'] - self.assertTrue(rsa_verify( - json.dumps(versions_info, sort_keys=True).encode(), - signature, UPDATES_RSA_KEY)) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_write_annotations.py.disabled b/test/test_write_annotations.py.disabled deleted file mode 100644 index c7cf199f6..000000000 --- a/test/test_write_annotations.py.disabled +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python3 - -# Allow direct execution -import os -import sys -import unittest - -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - - -import xml.etree.ElementTree - -import yt_dlp.extractor -import yt_dlp.YoutubeDL -from test.helper import get_params, is_download_test, try_rm - - -class YoutubeDL(yt_dlp.YoutubeDL): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.to_stderr = self.to_screen - - -params = get_params({ - 'writeannotations': True, - 'skip_download': True, - 'writeinfojson': False, - 'format': 'flv', -}) - - -TEST_ID = 'gr51aVj-mLg' -ANNOTATIONS_FILE = TEST_ID + '.annotations.xml' -EXPECTED_ANNOTATIONS = ['Speech bubble', 'Note', 'Title', 'Spotlight', 'Label'] - - -@is_download_test -class TestAnnotations(unittest.TestCase): - def setUp(self): - # Clear old files - self.tearDown() - - def test_info_json(self): - expected = list(EXPECTED_ANNOTATIONS) # Two annotations could have the same text. - ie = yt_dlp.extractor.YoutubeIE() - ydl = YoutubeDL(params) - ydl.add_info_extractor(ie) - ydl.download([TEST_ID]) - self.assertTrue(os.path.exists(ANNOTATIONS_FILE)) - annoxml = None - with open(ANNOTATIONS_FILE, encoding='utf-8') as annof: - annoxml = xml.etree.ElementTree.parse(annof) - self.assertTrue(annoxml is not None, 'Failed to parse annotations XML') - root = annoxml.getroot() - self.assertEqual(root.tag, 'document') - annotationsTag = root.find('annotations') - self.assertEqual(annotationsTag.tag, 'annotations') - annotations = annotationsTag.findall('annotation') - - # Not all the annotations have TEXT children and the annotations are returned unsorted. - for a in annotations: - self.assertEqual(a.tag, 'annotation') - if a.get('type') == 'text': - textTag = a.find('TEXT') - text = textTag.text - self.assertTrue(text in expected) # assertIn only added in python 2.7 - # remove the first occurrence, there could be more than one annotation with the same text - expected.remove(text) - # We should have seen (and removed) all the expected annotation texts. - self.assertEqual(len(expected), 0, 'Not all expected annotations were found.') - - def tearDown(self): - try_rm(ANNOTATIONS_FILE) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/versions.json b/test/versions.json deleted file mode 100644 index 6cccc2259..000000000 --- a/test/versions.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "latest": "2013.01.06", - "signature": "72158cdba391628569ffdbea259afbcf279bbe3d8aeb7492690735dc1cfa6afa754f55c61196f3871d429599ab22f2667f1fec98865527b32632e7f4b3675a7ef0f0fbe084d359256ae4bba68f0d33854e531a70754712f244be71d4b92e664302aa99653ee4df19800d955b6c4149cd2b3f24288d6e4b40b16126e01f4c8ce6", - "versions": { - "2013.01.02": { - "bin": [ - "http://youtube-dl.org/downloads/2013.01.02/youtube-dl", - "f5b502f8aaa77675c4884938b1e4871ebca2611813a0c0e74f60c0fbd6dcca6b" - ], - "exe": [ - "http://youtube-dl.org/downloads/2013.01.02/youtube-dl.exe", - "75fa89d2ce297d102ff27675aa9d92545bbc91013f52ec52868c069f4f9f0422" - ], - "tar": [ - "http://youtube-dl.org/downloads/2013.01.02/youtube-dl-2013.01.02.tar.gz", - "6a66d022ac8e1c13da284036288a133ec8dba003b7bd3a5179d0c0daca8c8196" - ] - }, - "2013.01.06": { - "bin": [ - "http://youtube-dl.org/downloads/2013.01.06/youtube-dl", - "64b6ed8865735c6302e836d4d832577321b4519aa02640dc508580c1ee824049" - ], - "exe": [ - "http://youtube-dl.org/downloads/2013.01.06/youtube-dl.exe", - "58609baf91e4389d36e3ba586e21dab882daaaee537e4448b1265392ae86ff84" - ], - "tar": [ - "http://youtube-dl.org/downloads/2013.01.06/youtube-dl-2013.01.06.tar.gz", - "fe77ab20a95d980ed17a659aa67e371fdd4d656d19c4c7950e7b720b0c2f1a86" - ] - } - } -}
\ No newline at end of file diff --git a/yt-dlp.sh b/yt-dlp.sh index 22a69250c..22a69250c 100755..100644 --- a/yt-dlp.sh +++ b/yt-dlp.sh diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 666d89b46..2d2e84fc2 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -59,8 +59,6 @@ from .postprocessor import ( MoveFilesAfterDownloadPP, get_postprocessor, ) -from .postprocessor.ffmpeg import resolve_mapping as resolve_recode_mapping -from .update import REPOSITORY, current_git_head, detect_variant from .utils import ( DEFAULT_OUTTMPL, IDENTITY, diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index 991dbcda7..34324ef85 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -1,12 +1,8 @@ -try: - import contextvars # noqa: F401 -except Exception: - raise Exception( - f'You are using an unsupported version of Python. Only Python versions 3.7 and above are supported by yt-dlp') # noqa: F541 +#!/usr/bin/python +f'You are using an unsupported version of Python. Only Python versions 3.6 and above are supported by yt-dlp' # noqa: F541 -__license__ = 'Public Domain' +__license__ = 'CC0-1.0' -import collections import getpass import itertools import optparse @@ -15,16 +11,16 @@ import re import sys import traceback -from .compat import compat_shlex_quote +from .compat import compat_shlex_quote, workaround_optparse_bug9161 from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS +from .downloader import FileDownloader from .downloader.external import get_external_downloader from .extractor import list_extractor_classes from .extractor.adobepass import MSO_INFO +from .extractor.common import InfoExtractor from .options import parseOpts from .postprocessor import ( FFmpegExtractAudioPP, - FFmpegMergerPP, - FFmpegPostProcessor, FFmpegSubtitlesConvertorPP, FFmpegThumbnailsConvertorPP, FFmpegVideoConvertorPP, @@ -32,14 +28,12 @@ from .postprocessor import ( MetadataFromFieldPP, MetadataParserPP, ) -from .update import Updater from .utils import ( NO_DEFAULT, POSTPROCESS_WHEN, DateRange, DownloadCancelled, DownloadError, - FormatSorter, GeoUtils, PlaylistEntries, SameFileError, @@ -50,7 +44,6 @@ from .utils import ( format_field, int_or_none, match_filter_func, - parse_bytes, parse_duration, preferredencoding, read_batch_urls, @@ -64,8 +57,6 @@ from .utils import ( from .utils.networking import std_headers from .YoutubeDL import YoutubeDL -_IN_CLI = False - def _exit(status=0, *args): for msg in args: @@ -107,17 +98,22 @@ def print_extractor_information(opts, urls): urls.update(dict.fromkeys(matched_urls, True)) out += ''.join(f' {url}\n' for url in matched_urls) elif opts.list_extractor_descriptions: - _SEARCHES = ('cute kittens', 'slithering pythons', 'falling cat', 'angry poodle', 'purple fish', 'running tortoise', 'sleeping bunny', 'burping cow') - out = '\n'.join( - ie.description(markdown=False, search_examples=_SEARCHES) - for ie in list_extractor_classes(opts.age_limit) if ie.working() and ie.IE_DESC is not False) + for ie in list_extractors(opts.age_limit): + if not ie.working(): + continue + if ie.IE_DESC is False: + continue + desc = ie.IE_DESC or ie.IE_NAME + if getattr(ie, 'SEARCH_KEY', None) is not None: + _SEARCHES = ('cute kittens', 'slithering pythons', 'falling cat', 'angry poodle', 'purple fish', 'running tortoise', 'sleeping bunny', 'burping cow') + _COUNTS = ('', '5', '10', 'all') + desc += f'; "{ie.SEARCH_KEY}:" prefix (Example: "{ie.SEARCH_KEY}{random.choice(_COUNTS)}:{random.choice(_SEARCHES)}")' + write_string(desc + '\n', out=sys.stdout) elif opts.ap_list_mso: - out = 'Supported TV Providers:\n%s\n' % render_table( - ['mso', 'mso name'], - [[mso_id, mso_info['name']] for mso_id, mso_info in MSO_INFO.items()]) + table = [[mso_id, mso_info['name']] for mso_id, mso_info in MSO_INFO.items()] + write_string('Supported TV Providers:\n' + render_table(['mso', 'mso name'], table) + '\n', out=sys.stdout) else: return False - write_string(out, out=sys.stdout) return True @@ -152,7 +148,7 @@ def set_compat_opts(opts): else: opts.embed_infojson = False if 'format-sort' in opts.compat_opts: - opts.format_sort.extend(FormatSorter.ytdl_default) + opts.format_sort.extend(InfoExtractor.FormatSort.ytdl_default) _video_multistreams_set = set_default_compat('multistreams', 'allow_multiple_video_streams', False, remove_compat=False) _audio_multistreams_set = set_default_compat('multistreams', 'allow_multiple_audio_streams', False, remove_compat=False) if _video_multistreams_set is False and _audio_multistreams_set is False: @@ -227,11 +223,9 @@ def validate_options(opts): # Format sort for f in opts.format_sort: - validate_regex('format sorting', f, FormatSorter.regex) + validate_regex('format sorting', f, InfoExtractor.FormatSort.regex) # Postprocessor formats - validate_regex('merge output format', opts.merge_output_format, - r'({0})(/({0}))*'.format('|'.join(map(re.escape, FFmpegMergerPP.SUPPORTED_EXTS)))) validate_regex('audio format', opts.audioformat, FFmpegExtractAudioPP.FORMAT_RE) validate_in('subtitle format', opts.convertsubtitles, FFmpegSubtitlesConvertorPP.SUPPORTED_EXTS) validate_regex('thumbnail format', opts.convertthumbnails, FFmpegThumbnailsConvertorPP.FORMAT_RE) @@ -281,19 +275,19 @@ def validate_options(opts): raise ValueError(f'invalid {key} retry sleep expression {expr!r}') # Bytes - def validate_bytes(name, value): + def parse_bytes(name, value): if value is None: return None - numeric_limit = parse_bytes(value) + numeric_limit = FileDownloader.parse_bytes(value) validate(numeric_limit is not None, 'rate limit', value) return numeric_limit - opts.ratelimit = validate_bytes('rate limit', opts.ratelimit) - opts.throttledratelimit = validate_bytes('throttled rate limit', opts.throttledratelimit) - opts.min_filesize = validate_bytes('min filesize', opts.min_filesize) - opts.max_filesize = validate_bytes('max filesize', opts.max_filesize) - opts.buffersize = validate_bytes('buffer size', opts.buffersize) - opts.http_chunk_size = validate_bytes('http chunk size', opts.http_chunk_size) + opts.ratelimit = parse_bytes('rate limit', opts.ratelimit) + opts.throttledratelimit = parse_bytes('throttled rate limit', opts.throttledratelimit) + opts.min_filesize = parse_bytes('min filesize', opts.min_filesize) + opts.max_filesize = parse_bytes('max filesize', opts.max_filesize) + opts.buffersize = parse_bytes('buffer size', opts.buffersize) + opts.http_chunk_size = parse_bytes('http chunk size', opts.http_chunk_size) # Output templates def validate_outtmpl(tmpl, msg): @@ -375,7 +369,7 @@ def validate_options(opts): ''', opts.cookiesfrombrowser) if mobj is None: raise ValueError(f'invalid cookies from browser arguments: {opts.cookiesfrombrowser}') - browser_name, keyring, profile, container = mobj.group('name', 'keyring', 'profile', 'container') + browser_name, keyring, profile = mobj.group('name', 'keyring', 'profile') browser_name = browser_name.lower() if browser_name not in SUPPORTED_BROWSERS: raise ValueError(f'unsupported browser specified for cookies: "{browser_name}". ' @@ -385,7 +379,7 @@ def validate_options(opts): if keyring not in SUPPORTED_KEYRINGS: raise ValueError(f'unsupported keyring specified for cookies: "{keyring}". ' f'Supported keyrings are: {", ".join(sorted(SUPPORTED_KEYRINGS))}') - opts.cookiesfrombrowser = (browser_name, profile, keyring, container) + opts.cookiesfrombrowser = (browser_name, profile, keyring) # MetadataParser def metadataparser_actions(f): @@ -437,9 +431,6 @@ def validate_options(opts): if opts.download_archive is not None: opts.download_archive = expand_path(opts.download_archive) - if opts.ffmpeg_location is not None: - opts.ffmpeg_location = expand_path(opts.ffmpeg_location) - if opts.user_agent is not None: opts.headers.setdefault('User-Agent', opts.user_agent) if opts.referer is not None: @@ -508,24 +499,22 @@ def validate_options(opts): report_conflict('--playlist-random', 'playlist_random', '--lazy-playlist', 'lazy_playlist') report_conflict('--dateafter', 'dateafter', '--date', 'date', default=None) report_conflict('--datebefore', 'datebefore', '--date', 'date', default=None) - report_conflict('--exec-before-download', 'exec_before_dl_cmd', - '"--exec before_dl:"', 'exec_cmd', val2=opts.exec_cmd.get('before_dl')) + report_conflict('--exec-before-download', 'exec_before_dl_cmd', '"--exec before_dl:"', 'exec_cmd', opts.exec_cmd.get('before_dl')) report_conflict('--id', 'useid', '--output', 'outtmpl', val2=opts.outtmpl.get('default')) report_conflict('--remux-video', 'remuxvideo', '--recode-video', 'recodevideo') report_conflict('--sponskrub', 'sponskrub', '--remove-chapters', 'remove_chapters') report_conflict('--sponskrub', 'sponskrub', '--sponsorblock-mark', 'sponsorblock_mark') report_conflict('--sponskrub', 'sponskrub', '--sponsorblock-remove', 'sponsorblock_remove') - report_conflict('--sponskrub-cut', 'sponskrub_cut', '--split-chapter', 'split_chapters', - val1=opts.sponskrub and opts.sponskrub_cut) + report_conflict('--sponskrub-cut', 'sponskrub_cut', '--split-chapter', 'split_chapters', val1=opts.sponskrub and opts.sponskrub_cut) # Conflicts with --allow-unplayable-formats - report_conflict('--embed-metadata', 'addmetadata') + report_conflict('--add-metadata', 'addmetadata') report_conflict('--embed-chapters', 'addchapters') report_conflict('--embed-info-json', 'embed_infojson') report_conflict('--embed-subs', 'embedsubtitles') report_conflict('--embed-thumbnail', 'embedthumbnail') report_conflict('--extract-audio', 'extractaudio') - report_conflict('--fixup', 'fixup', val1=opts.fixup not in (None, 'never', 'ignore'), default='never') + report_conflict('--fixup', 'fixup', val1=(opts.fixup or '').lower() in ('', 'never', 'ignore'), default='never') report_conflict('--recode-video', 'recodevideo') report_conflict('--remove-chapters', 'remove_chapters', default=[]) report_conflict('--remux-video', 'remuxvideo') @@ -567,7 +556,7 @@ def validate_options(opts): # Do not unnecessarily download audio opts.format = 'bestaudio/best' - if opts.getcomments and opts.writeinfojson is None and not opts.embed_infojson: + if opts.getcomments and opts.writeinfojson is None: # If JSON is not printed anywhere, but comments are requested, save it to file if not opts.dumpjson or opts.print_json or opts.dump_single_json: opts.writeinfojson = True @@ -716,11 +705,8 @@ def get_postprocessors(opts): } -ParsedOptions = collections.namedtuple('ParsedOptions', ('parser', 'options', 'urls', 'ydl_opts')) - - def parse_options(argv=None): - """@returns ParsedOptions(parser, opts, urls, ydl_opts)""" + """ @returns (parser, opts, urls, ydl_opts) """ parser, opts, urls = parseOpts(argv) urls = get_urls(urls, opts.batchfile, opts.verbose) @@ -740,20 +726,7 @@ def parse_options(argv=None): if opts.quiet is None: opts.quiet = any_getting or opts.print_json or bool(opts.forceprint) - playlist_pps = [pp for pp in postprocessors if pp.get('when') == 'playlist'] - write_playlist_infojson = (opts.writeinfojson and not opts.clean_infojson - and opts.allow_playlist_files and opts.outtmpl.get('pl_infojson') != '') - if not any(( - opts.extract_flat, - opts.dump_single_json, - opts.forceprint.get('playlist'), - opts.print_to_file.get('playlist'), - write_playlist_infojson, - )): - if not playlist_pps: - opts.extract_flat = 'discard' - elif playlist_pps == [{'key': 'FFmpegConcat', 'only_multi_video': True, 'when': 'playlist'}]: - opts.extract_flat = 'discard_in_playlist' + any_printing = opts.print_json final_ext = ( opts.recodevideo if opts.recodevideo in FFmpegVideoConvertorPP.SUPPORTED_EXTS @@ -761,7 +734,7 @@ def parse_options(argv=None): else opts.audioformat if (opts.extractaudio and opts.audioformat in FFmpegExtractAudioPP.SUPPORTED_EXTS) else None) - return ParsedOptions(parser, opts, urls, { + return parser, opts, urls, { 'usenetrc': opts.usenetrc, 'netrc_location': opts.netrc_location, 'netrc_cmd': opts.netrc_cmd, @@ -790,7 +763,7 @@ def parse_options(argv=None): 'forcejson': opts.dumpjson or opts.print_json, 'dump_single_json': opts.dump_single_json, 'force_write_download_archive': opts.force_write_download_archive, - 'simulate': (print_only or any_getting or None) if opts.simulate is None else opts.simulate, + 'simulate': (any_getting or None) if opts.simulate is None else opts.simulate, 'skip_download': opts.skip_download, 'format': opts.format, 'allow_unplayable_formats': opts.allow_unplayable_formats, @@ -811,7 +784,6 @@ def parse_options(argv=None): 'windowsfilenames': opts.windowsfilenames, 'ignoreerrors': opts.ignoreerrors, 'force_generic_extractor': opts.force_generic_extractor, - 'allowed_extractors': opts.allowed_extractors or ['default'], 'ratelimit': opts.ratelimit, 'throttledratelimit': opts.throttledratelimit, 'overwrites': opts.overwrites, @@ -937,10 +909,17 @@ def parse_options(argv=None): '_warnings': warnings, '_deprecation_warnings': deprecation_warnings, 'compat_opts': opts.compat_opts, - }) + } def _real_main(argv=None): + # Compatibility fixes for Windows + if sys.platform == 'win32': + # https://github.com/ytdl-org/youtube-dl/issues/820 + codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None) + + workaround_optparse_bug9161() + setproctitle('yt-dlp') parser, opts, all_urls, ydl_opts = parse_options(argv) @@ -954,11 +933,6 @@ def _real_main(argv=None): if print_extractor_information(opts, all_urls): return - # We may need ffmpeg_location without having access to the YoutubeDL instance - # See https://github.com/yt-dlp/yt-dlp/issues/2191 - if opts.ffmpeg_location: - FFmpegPostProcessor._ffmpeg_location.set(opts.ffmpeg_location) - with YoutubeDL(ydl_opts) as ydl: pre_process = opts.update_self or opts.rm_cachedir actual_use = all_urls or opts.load_info_filename @@ -1002,8 +976,6 @@ def _real_main(argv=None): def main(argv=None): - global _IN_CLI - _IN_CLI = True try: _exit(*variadic(_real_main(argv))) except DownloadError: diff --git a/yt_dlp/downloader/hls.py b/yt_dlp/downloader/hls.py index d4b3f0320..6eee71a8c 100644 --- a/yt_dlp/downloader/hls.py +++ b/yt_dlp/downloader/hls.py @@ -83,9 +83,9 @@ class HlsFD(FragmentFD): has_ffmpeg = FFmpegFD.available() no_crypto = not Cryptodome.AES and '#EXT-X-KEY:METHOD=AES-128' in s if no_crypto and has_ffmpeg: - can_download, message = False, 'The stream has AES-128 encryption and pycryptodomex is not available' + can_download, message = False, 'The stream has AES-128 encryption and pycryptodome is not available' elif no_crypto: - message = ('The stream has AES-128 encryption and neither ffmpeg nor pycryptodomex are available; ' + message = ('The stream has AES-128 encryption and neither ffmpeg nor pycryptodome are available; ' 'Decryption will be performed natively, but will be extremely slow') elif info_dict.get('extractor_key') == 'Generic' and re.search(r'(?m)#EXT-X-MEDIA-SEQUENCE:(?!0$)', s): install_ffmpeg = '' if has_ffmpeg else 'install ffmpeg and ' diff --git a/yt_dlp/extractor/iqiyi.py b/yt_dlp/extractor/iqiyi.py index fa602ba88..94bcad412 100644 --- a/yt_dlp/extractor/iqiyi.py +++ b/yt_dlp/extractor/iqiyi.py @@ -6,13 +6,11 @@ import time from .common import InfoExtractor from ..compat import ( compat_str, - compat_urllib_parse_urlencode, compat_urllib_parse_unquote ) from .openload import PhantomJSwrapper from ..utils import ( clean_html, - decode_packed_codes, ExtractorError, float_or_none, format_field, @@ -37,135 +35,6 @@ def md5_text(text): return hashlib.md5(text.encode('utf-8')).hexdigest() -class IqiyiSDK: - def __init__(self, target, ip, timestamp): - self.target = target - self.ip = ip - self.timestamp = timestamp - - @staticmethod - def split_sum(data): - return compat_str(sum(map(lambda p: int(p, 16), list(data)))) - - @staticmethod - def digit_sum(num): - if isinstance(num, int): - num = compat_str(num) - return compat_str(sum(map(int, num))) - - def even_odd(self): - even = self.digit_sum(compat_str(self.timestamp)[::2]) - odd = self.digit_sum(compat_str(self.timestamp)[1::2]) - return even, odd - - def preprocess(self, chunksize): - self.target = md5_text(self.target) - chunks = [] - for i in range(32 // chunksize): - chunks.append(self.target[chunksize * i:chunksize * (i + 1)]) - if 32 % chunksize: - chunks.append(self.target[32 - 32 % chunksize:]) - return chunks, list(map(int, self.ip.split('.'))) - - def mod(self, modulus): - chunks, ip = self.preprocess(32) - self.target = chunks[0] + ''.join(map(lambda p: compat_str(p % modulus), ip)) - - def split(self, chunksize): - modulus_map = { - 4: 256, - 5: 10, - 8: 100, - } - - chunks, ip = self.preprocess(chunksize) - ret = '' - for i in range(len(chunks)): - ip_part = compat_str(ip[i] % modulus_map[chunksize]) if i < 4 else '' - if chunksize == 8: - ret += ip_part + chunks[i] - else: - ret += chunks[i] + ip_part - self.target = ret - - def handle_input16(self): - self.target = md5_text(self.target) - self.target = self.split_sum(self.target[:16]) + self.target + self.split_sum(self.target[16:]) - - def handle_input8(self): - self.target = md5_text(self.target) - ret = '' - for i in range(4): - part = self.target[8 * i:8 * (i + 1)] - ret += self.split_sum(part) + part - self.target = ret - - def handleSum(self): - self.target = md5_text(self.target) - self.target = self.split_sum(self.target) + self.target - - def date(self, scheme): - self.target = md5_text(self.target) - d = time.localtime(self.timestamp) - strings = { - 'y': compat_str(d.tm_year), - 'm': '%02d' % d.tm_mon, - 'd': '%02d' % d.tm_mday, - } - self.target += ''.join(map(lambda c: strings[c], list(scheme))) - - def split_time_even_odd(self): - even, odd = self.even_odd() - self.target = odd + md5_text(self.target) + even - - def split_time_odd_even(self): - even, odd = self.even_odd() - self.target = even + md5_text(self.target) + odd - - def split_ip_time_sum(self): - chunks, ip = self.preprocess(32) - self.target = compat_str(sum(ip)) + chunks[0] + self.digit_sum(self.timestamp) - - def split_time_ip_sum(self): - chunks, ip = self.preprocess(32) - self.target = self.digit_sum(self.timestamp) + chunks[0] + compat_str(sum(ip)) - - -class IqiyiSDKInterpreter: - def __init__(self, sdk_code): - self.sdk_code = sdk_code - - def run(self, target, ip, timestamp): - self.sdk_code = decode_packed_codes(self.sdk_code) - - functions = re.findall(r'input=([a-zA-Z0-9]+)\(input', self.sdk_code) - - sdk = IqiyiSDK(target, ip, timestamp) - - other_functions = { - 'handleSum': sdk.handleSum, - 'handleInput8': sdk.handle_input8, - 'handleInput16': sdk.handle_input16, - 'splitTimeEvenOdd': sdk.split_time_even_odd, - 'splitTimeOddEven': sdk.split_time_odd_even, - 'splitIpTimeSum': sdk.split_ip_time_sum, - 'splitTimeIpSum': sdk.split_time_ip_sum, - } - for function in functions: - if re.match(r'mod\d+', function): - sdk.mod(int(function[3:])) - elif re.match(r'date[ymd]{3}', function): - sdk.date(function[4:]) - elif re.match(r'split\d+', function): - sdk.split(int(function[5:])) - elif function in other_functions: - other_functions[function]() - else: - raise ExtractorError('Unknown function %s' % function) - - return sdk.target - - class IqiyiIE(InfoExtractor): IE_NAME = 'iqiyi' IE_DESC = '爱奇艺' @@ -246,47 +115,8 @@ class IqiyiIE(InfoExtractor): return ohdave_rsa_encrypt(data, e, N) - def _perform_login(self, username, password): - - data = self._download_json( - 'http://kylin.iqiyi.com/get_token', None, - note='Get token for logging', errnote='Unable to get token for logging') - sdk = data['sdk'] - timestamp = int(time.time()) - target = '/apis/reglogin/login.action?lang=zh_TW&area_code=null&email=%s&passwd=%s&agenttype=1&from=undefined&keeplogin=0&piccode=&fromurl=&_pos=1' % ( - username, self._rsa_fun(password.encode('utf-8'))) - - interp = IqiyiSDKInterpreter(sdk) - sign = interp.run(target, data['ip'], timestamp) - - validation_params = { - 'target': target, - 'server': 'BEA3AA1908656AABCCFF76582C4C6660', - 'token': data['token'], - 'bird_src': 'f8d91d57af224da7893dd397d52d811a', - 'sign': sign, - 'bird_t': timestamp, - } - validation_result = self._download_json( - 'http://kylin.iqiyi.com/validate?' + compat_urllib_parse_urlencode(validation_params), None, - note='Validate credentials', errnote='Unable to validate credentials') - - MSG_MAP = { - 'P00107': 'please login via the web interface and enter the CAPTCHA code', - 'P00117': 'bad username or password', - } - - code = validation_result['code'] - if code != 'A00000': - msg = MSG_MAP.get(code) - if not msg: - msg = 'error %s' % code - if validation_result.get('msg'): - msg += ': ' + validation_result['msg'] - self.report_warning('unable to log in: ' + msg) - return False - - return True + def _perform_login(self): + raise ExtractorError("iQiyi's non-free authentication algorithm has made login impossible", expected=True) def get_raw_data(self, tvid, video_id): tm = int(time.time() * 1000) diff --git a/yt_dlp/extractor/ivi.py b/yt_dlp/extractor/ivi.py index fa5ceec95..e7ba5f339 100644 --- a/yt_dlp/extractor/ivi.py +++ b/yt_dlp/extractor/ivi.py @@ -126,8 +126,8 @@ class IviIE(InfoExtractor): extractor_msg = 'Video %s does not exist' elif site == 353: continue - elif not Cryptodome.CMAC: - raise ExtractorError('pycryptodomex not found. Please install', expected=True) + elif not pycryptodome_found: + raise ExtractorError('pycryptodome not found. Please install', expected=True) elif message: extractor_msg += ': ' + message raise ExtractorError(extractor_msg % video_id, expected=True) diff --git a/yt_dlp/options.py b/yt_dlp/options.py index 163809706..9e71108ab 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -20,7 +20,6 @@ from .postprocessor import ( SponsorBlockPP, ) from .postprocessor.modify_chapters import DEFAULT_SPONSORBLOCK_CHAPTER_TITLE -from .update import UPDATE_SOURCES, detect_variant, is_non_updateable from .utils import ( OUTTMPL_TYPES, POSTPROCESS_WHEN, @@ -157,7 +156,7 @@ class _YoutubeDLOptionParser(optparse.OptionParser): def __init__(self): super().__init__( - prog='yt-dlp' if detect_variant() == 'source' else None, + prog='yt-dlp', version=__version__, usage='%prog [OPTIONS] URL [URL...]', epilog='See full documentation at https://github.com/yt-dlp/yt-dlp#readme', @@ -323,23 +322,6 @@ def create_parser(): action='version', help='Print program version and exit') general.add_option( - '-U', '--update', - action='store_const', dest='update_self', const=CHANNEL, - help=format_field( - is_non_updateable(), None, 'Check if updates are available. %s', - default=f'Update this program to the latest {CHANNEL} version')) - general.add_option( - '--no-update', - action='store_false', dest='update_self', - help='Do not check for updates (default)') - general.add_option( - '--update-to', - action='store', dest='update_self', metavar='[CHANNEL]@[TAG]', - help=( - 'Upgrade/downgrade to a specific version. CHANNEL can be a repository as well. ' - f'CHANNEL and TAG default to "{CHANNEL.partition("@")[0]}" and "latest" respectively if omitted; ' - f'See "UPDATE" for details. Supported channels: {", ".join(UPDATE_SOURCES)}')) - general.add_option( '-i', '--ignore-errors', action='store_true', dest='ignoreerrors', help='Ignore download and postprocessing errors. The download will be considered successful even if the postprocessing fails') diff --git a/yt_dlp/update.py b/yt_dlp/update.py deleted file mode 100644 index d708b09e3..000000000 --- a/yt_dlp/update.py +++ /dev/null @@ -1,439 +0,0 @@ -import atexit -import contextlib -import hashlib -import json -import os -import platform -import re -import subprocess -import sys -from zipimport import zipimporter - -from .compat import functools # isort: split -from .compat import compat_realpath, compat_shlex_quote -from .networking import Request -from .networking.exceptions import HTTPError, network_exceptions -from .utils import ( - Popen, - cached_method, - deprecation_warning, - remove_end, - remove_start, - shell_quote, - system_identifier, - version_tuple, -) -from .version import CHANNEL, UPDATE_HINT, VARIANT, __version__ - -UPDATE_SOURCES = { - 'stable': 'yt-dlp/yt-dlp', - 'nightly': 'yt-dlp/yt-dlp-nightly-builds', -} -REPOSITORY = UPDATE_SOURCES['stable'] - -_VERSION_RE = re.compile(r'(\d+\.)*\d+') - -API_BASE_URL = 'https://api.github.com/repos' - -# Backwards compatibility variables for the current channel -API_URL = f'{API_BASE_URL}/{REPOSITORY}/releases' - - -@functools.cache -def _get_variant_and_executable_path(): - """@returns (variant, executable_path)""" - if getattr(sys, 'frozen', False): - path = sys.executable - if not hasattr(sys, '_MEIPASS'): - return 'py2exe', path - elif sys._MEIPASS == os.path.dirname(path): - return f'{sys.platform}_dir', path - elif sys.platform == 'darwin': - machine = '_legacy' if version_tuple(platform.mac_ver()[0]) < (10, 15) else '' - else: - machine = f'_{platform.machine().lower()}' - # Ref: https://en.wikipedia.org/wiki/Uname#Examples - if machine[1:] in ('x86', 'x86_64', 'amd64', 'i386', 'i686'): - machine = '_x86' if platform.architecture()[0][:2] == '32' else '' - return f'{remove_end(sys.platform, "32")}{machine}_exe', path - - path = os.path.dirname(__file__) - if isinstance(__loader__, zipimporter): - return 'zip', os.path.join(path, '..') - elif (os.path.basename(sys.argv[0]) in ('__main__.py', '-m') - and os.path.exists(os.path.join(path, '../.git/HEAD'))): - return 'source', path - return 'unknown', path - - -def detect_variant(): - return VARIANT or _get_variant_and_executable_path()[0] - - -@functools.cache -def current_git_head(): - if detect_variant() != 'source': - return - with contextlib.suppress(Exception): - stdout, _, _ = Popen.run( - ['git', 'rev-parse', '--short', 'HEAD'], - text=True, cwd=os.path.dirname(os.path.abspath(__file__)), - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - if re.fullmatch('[0-9a-f]+', stdout.strip()): - return stdout.strip() - - -_FILE_SUFFIXES = { - 'zip': '', - 'py2exe': '_min.exe', - 'win_exe': '.exe', - 'win_x86_exe': '_x86.exe', - 'darwin_exe': '_macos', - 'darwin_legacy_exe': '_macos_legacy', - 'linux_exe': '_linux', - 'linux_aarch64_exe': '_linux_aarch64', - 'linux_armv7l_exe': '_linux_armv7l', -} - -_NON_UPDATEABLE_REASONS = { - **{variant: None for variant in _FILE_SUFFIXES}, # Updatable - **{variant: f'Auto-update is not supported for unpackaged {name} executable; Re-download the latest release' - for variant, name in {'win32_dir': 'Windows', 'darwin_dir': 'MacOS', 'linux_dir': 'Linux'}.items()}, - 'source': 'You cannot update when running from source code; Use git to pull the latest changes', - 'unknown': 'You installed yt-dlp with a package manager or setup.py; Use that to update', - 'other': 'You are using an unofficial build of yt-dlp; Build the executable again', -} - - -def is_non_updateable(): - if UPDATE_HINT: - return UPDATE_HINT - return _NON_UPDATEABLE_REASONS.get( - detect_variant(), _NON_UPDATEABLE_REASONS['unknown' if VARIANT else 'other']) - - -def _sha256_file(path): - h = hashlib.sha256() - mv = memoryview(bytearray(128 * 1024)) - with open(os.path.realpath(path), 'rb', buffering=0) as f: - for n in iter(lambda: f.readinto(mv), 0): - h.update(mv[:n]) - return h.hexdigest() - - -class Updater: - _exact = True - - def __init__(self, ydl, target=None): - self.ydl = ydl - - self.target_channel, sep, self.target_tag = (target or CHANNEL).rpartition('@') - # stable => stable@latest - if not sep and ('/' in self.target_tag or self.target_tag in UPDATE_SOURCES): - self.target_channel = self.target_tag - self.target_tag = None - elif not self.target_channel: - self.target_channel = CHANNEL.partition('@')[0] - - if not self.target_tag: - self.target_tag = 'latest' - self._exact = False - elif self.target_tag != 'latest': - self.target_tag = f'tags/{self.target_tag}' - - if '/' in self.target_channel: - self._target_repo = self.target_channel - if self.target_channel not in (CHANNEL, *UPDATE_SOURCES.values()): - self.ydl.report_warning( - f'You are switching to an {self.ydl._format_err("unofficial", "red")} executable ' - f'from {self.ydl._format_err(self._target_repo, self.ydl.Styles.EMPHASIS)}. ' - f'Run {self.ydl._format_err("at your own risk", "light red")}') - self._block_restart('Automatically restarting into custom builds is disabled for security reasons') - else: - self._target_repo = UPDATE_SOURCES.get(self.target_channel) - if not self._target_repo: - self._report_error( - f'Invalid update channel {self.target_channel!r} requested. ' - f'Valid channels are {", ".join(UPDATE_SOURCES)}', True) - - def _version_compare(self, a, b, channel=CHANNEL): - if self._exact and channel != self.target_channel: - return False - - if _VERSION_RE.fullmatch(f'{a}.{b}'): - a, b = version_tuple(a), version_tuple(b) - return a == b if self._exact else a >= b - return a == b - - @functools.cached_property - def _tag(self): - if self._version_compare(self.current_version, self.latest_version): - return self.target_tag - - identifier = f'{detect_variant()} {self.target_channel} {system_identifier()}' - for line in self._download('_update_spec', 'latest').decode().splitlines(): - if not line.startswith('lock '): - continue - _, tag, pattern = line.split(' ', 2) - if re.match(pattern, identifier): - if not self._exact: - return f'tags/{tag}' - elif self.target_tag == 'latest' or not self._version_compare( - tag, self.target_tag[5:], channel=self.target_channel): - self._report_error( - f'yt-dlp cannot be updated above {tag} since you are on an older Python version', True) - return f'tags/{self.current_version}' - return self.target_tag - - @cached_method - def _get_version_info(self, tag): - url = f'{API_BASE_URL}/{self._target_repo}/releases/{tag}' - self.ydl.write_debug(f'Fetching release info: {url}') - return json.loads(self.ydl.urlopen(Request(url, headers={ - 'Accept': 'application/vnd.github+json', - 'User-Agent': 'yt-dlp', - 'X-GitHub-Api-Version': '2022-11-28', - })).read().decode()) - - @property - def current_version(self): - """Current version""" - return __version__ - - @staticmethod - def _label(channel, tag): - """Label for a given channel and tag""" - return f'{channel}@{remove_start(tag, "tags/")}' - - def _get_actual_tag(self, tag): - if tag.startswith('tags/'): - return tag[5:] - return self._get_version_info(tag)['tag_name'] - - @property - def new_version(self): - """Version of the latest release we can update to""" - return self._get_actual_tag(self._tag) - - @property - def latest_version(self): - """Version of the target release""" - return self._get_actual_tag(self.target_tag) - - @property - def has_update(self): - """Whether there is an update available""" - return not self._version_compare(self.current_version, self.new_version) - - @functools.cached_property - def filename(self): - """Filename of the executable""" - return compat_realpath(_get_variant_and_executable_path()[1]) - - def _download(self, name, tag): - slug = 'latest/download' if tag == 'latest' else f'download/{tag[5:]}' - url = f'https://github.com/{self._target_repo}/releases/{slug}/{name}' - self.ydl.write_debug(f'Downloading {name} from {url}') - return self.ydl.urlopen(url).read() - - @functools.cached_property - def release_name(self): - """The release filename""" - return f'yt-dlp{_FILE_SUFFIXES[detect_variant()]}' - - @functools.cached_property - def release_hash(self): - """Hash of the latest release""" - hash_data = dict(ln.split()[::-1] for ln in self._download('SHA2-256SUMS', self._tag).decode().splitlines()) - return hash_data[self.release_name] - - def _report_error(self, msg, expected=False): - self.ydl.report_error(msg, tb=False if expected else None) - self.ydl._download_retcode = 100 - - def _report_permission_error(self, file): - self._report_error(f'Unable to write to {file}; Try running as administrator', True) - - def _report_network_error(self, action, delim=';'): - self._report_error( - f'Unable to {action}{delim} visit ' - f'https://github.com/{self._target_repo}/releases/{self.target_tag.replace("tags/", "tag/")}', True) - - def check_update(self): - """Report whether there is an update available""" - if not self._target_repo: - return False - try: - self.ydl.to_screen(( - f'Available version: {self._label(self.target_channel, self.latest_version)}, ' if self.target_tag == 'latest' else '' - ) + f'Current version: {self._label(CHANNEL, self.current_version)}') - except network_exceptions as e: - return self._report_network_error(f'obtain version info ({e})', delim='; Please try again later or') - - if not is_non_updateable(): - self.ydl.to_screen(f'Current Build Hash: {_sha256_file(self.filename)}') - - if self.has_update: - return True - - if self.target_tag == self._tag: - self.ydl.to_screen(f'yt-dlp is up to date ({self._label(CHANNEL, self.current_version)})') - elif not self._exact: - self.ydl.report_warning('yt-dlp cannot be updated any further since you are on an older Python version') - return False - - def update(self): - """Update yt-dlp executable to the latest version""" - if not self.check_update(): - return - err = is_non_updateable() - if err: - return self._report_error(err, True) - self.ydl.to_screen(f'Updating to {self._label(self.target_channel, self.new_version)} ...') - if (_VERSION_RE.fullmatch(self.target_tag[5:]) - and version_tuple(self.target_tag[5:]) < (2023, 3, 2)): - self.ydl.report_warning('You are downgrading to a version without --update-to') - self._block_restart('Cannot automatically restart to a version without --update-to') - - directory = os.path.dirname(self.filename) - if not os.access(self.filename, os.W_OK): - return self._report_permission_error(self.filename) - elif not os.access(directory, os.W_OK): - return self._report_permission_error(directory) - - new_filename, old_filename = f'{self.filename}.new', f'{self.filename}.old' - if detect_variant() == 'zip': # Can be replaced in-place - new_filename, old_filename = self.filename, None - - try: - if os.path.exists(old_filename or ''): - os.remove(old_filename) - except OSError: - return self._report_error('Unable to remove the old version') - - try: - newcontent = self._download(self.release_name, self._tag) - except network_exceptions as e: - if isinstance(e, HTTPError) and e.status == 404: - return self._report_error( - f'The requested tag {self._label(self.target_channel, self.target_tag)} does not exist', True) - return self._report_network_error(f'fetch updates: {e}') - - try: - expected_hash = self.release_hash - except Exception: - self.ydl.report_warning('no hash information found for the release') - else: - if hashlib.sha256(newcontent).hexdigest() != expected_hash: - return self._report_network_error('verify the new executable') - - try: - with open(new_filename, 'wb') as outf: - outf.write(newcontent) - except OSError: - return self._report_permission_error(new_filename) - - if old_filename: - mask = os.stat(self.filename).st_mode - try: - os.rename(self.filename, old_filename) - except OSError: - return self._report_error('Unable to move current version') - - try: - os.rename(new_filename, self.filename) - except OSError: - self._report_error('Unable to overwrite current version') - return os.rename(old_filename, self.filename) - - variant = detect_variant() - if variant.startswith('win') or variant == 'py2exe': - atexit.register(Popen, f'ping 127.0.0.1 -n 5 -w 1000 & del /F "{old_filename}"', - shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - elif old_filename: - try: - os.remove(old_filename) - except OSError: - self._report_error('Unable to remove the old version') - - try: - os.chmod(self.filename, mask) - except OSError: - return self._report_error( - f'Unable to set permissions. Run: sudo chmod a+rx {compat_shlex_quote(self.filename)}') - - self.ydl.to_screen(f'Updated yt-dlp to {self._label(self.target_channel, self.new_version)}') - return True - - @functools.cached_property - def cmd(self): - """The command-line to run the executable, if known""" - # There is no sys.orig_argv in py < 3.10. Also, it can be [] when frozen - if getattr(sys, 'orig_argv', None): - return sys.orig_argv - elif getattr(sys, 'frozen', False): - return sys.argv - - def restart(self): - """Restart the executable""" - assert self.cmd, 'Must be frozen or Py >= 3.10' - self.ydl.write_debug(f'Restarting: {shell_quote(self.cmd)}') - _, _, returncode = Popen.run(self.cmd) - return returncode - - def _block_restart(self, msg): - def wrapper(): - self._report_error(f'{msg}. Restart yt-dlp to use the updated version', expected=True) - return self.ydl._download_retcode - self.restart = wrapper - - -def run_update(ydl): - """Update the program file with the latest version from the repository - @returns Whether there was a successful update (No update = False) - """ - return Updater(ydl).update() - - -# Deprecated -def update_self(to_screen, verbose, opener): - import traceback - - deprecation_warning(f'"{__name__}.update_self" is deprecated and may be removed ' - f'in a future version. Use "{__name__}.run_update(ydl)" instead') - - printfn = to_screen - - class FakeYDL(): - to_screen = printfn - - def report_warning(self, msg, *args, **kwargs): - return printfn(f'WARNING: {msg}', *args, **kwargs) - - def report_error(self, msg, tb=None): - printfn(f'ERROR: {msg}') - if not verbose: - return - if tb is None: - # Copied from YoutubeDL.trouble - if sys.exc_info()[0]: - tb = '' - if hasattr(sys.exc_info()[1], 'exc_info') and sys.exc_info()[1].exc_info[0]: - tb += ''.join(traceback.format_exception(*sys.exc_info()[1].exc_info)) - tb += traceback.format_exc() - else: - tb_data = traceback.format_list(traceback.extract_stack()) - tb = ''.join(tb_data) - if tb: - printfn(tb) - - def write_debug(self, msg, *args, **kwargs): - printfn(f'[debug] {msg}', *args, **kwargs) - - def urlopen(self, url): - return opener.open(url) - - return run_update(FakeYDL()) - - -__all__ = ['Updater'] diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py index f5552ce80..3d27510ea 100644 --- a/yt_dlp/utils/_utils.py +++ b/yt_dlp/utils/_utils.py @@ -882,10 +882,9 @@ def formatSeconds(secs, delim=':', msec=False): def bug_reports_message(before=';'): - from ..update import REPOSITORY - - msg = (f'please report this issue on https://github.com/{REPOSITORY}/issues?q= , ' - 'filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U') + msg = ('please report this issue on https://issues.hyperbola.info/ , ' + 'filling out the appropriate issue template. ' + 'Confirm you are on the latest version using pacman -Su') before = before.rstrip() if not before or before.endswith(('.', '!', '?')): @@ -4613,9 +4612,14 @@ def make_dir(path, to_screen=None): def get_executable_path(): - from ..update import _get_variant_and_executable_path - - return os.path.dirname(os.path.abspath(_get_variant_and_executable_path()[1])) + from zipimport import zipimporter + if hasattr(sys, 'frozen'): # Running from PyInstaller + path = os.path.dirname(sys.executable) + elif isinstance(globals().get('__loader__'), zipimporter): # Running from ZIP + path = os.path.join(os.path.dirname(__file__), '../..') + else: + path = os.path.join(os.path.dirname(__file__), '..') + return os.path.abspath(path) def get_user_config_dirs(package_name): |