Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] [Youtube] Allow users to add to Invidious instances #7403

Closed
9 of 10 tasks
264-bit opened this issue Jun 24, 2023 · 3 comments
Closed
9 of 10 tasks

[Feature Request] [Youtube] Allow users to add to Invidious instances #7403

264-bit opened this issue Jun 24, 2023 · 3 comments
Labels
question Question

Comments

@264-bit
Copy link

264-bit commented Jun 24, 2023

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

No response

Example URLs

https://piped-material.ftp.sh/

Provide a description that is worded well enough to be understood

Please consider allowing users to add to the list of known invidious instances, via a command line arg, config file or similar.
This will help with niche youtube frontends such as piped-material. It also helps with the sometimes rapid pace of new instances, now users don't have to wait for yt-dlp to be updated with every new instance.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

yt-dlp -vU 'https://piped-material.ftp.sh/watch?v=6IxqZOK_dpU'
[debug] Command-line config: ['-vU', 'https://piped-material.ftp.sh/watch?v=6IxqZOK_dpU']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.06.22 [812cdfa06]
[debug] Python 3.11.4 (CPython x86_64 64bit) - Linux-6.3.8-1-cachyos-x86_64-with-glibc2.37 (OpenSSL 3.1.1 30 May 2023, glibc 2.37)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.12.0, brotli-1.0.9, certifi-2023.05.07, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Post-Processor Plugins: YoutubeDashGeneratorPP
[debug] Plugin directories: ['/home/user/.config/yt-dlp/plugins/ytdashgen/yt_dlp_plugins']
[debug] Loaded 1851 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.06.22, Current version: stable@2023.06.22
yt-dlp is up to date (stable@2023.06.22)
[generic] Extracting URL: https://piped-material.ftp.sh/watch?v=6IxqZOK_dpU
[generic] watch?v=6IxqZOK_dpU: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] watch?v=6IxqZOK_dpU: Extracting information
[debug] Looking for embeds
ERROR: Unsupported URL: https://piped-material.ftp.sh/watch?v=6IxqZOK_dpU
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1555, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1631, in __extract_info
    ie_result = ie.extract(url)
                ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 708, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/yt_dlp/extractor/generic.py", line 2568, in _real_extract
    raise UnsupportedError(url)
yt_dlp.utils.UnsupportedError: Unsupported URL: https://piped-material.ftp.sh/watch?v=6IxqZOK_dpU
@264-bit 264-bit added site-enhancement Feature request for some website triage Untriaged issue labels Jun 24, 2023
@gamer191
Copy link
Collaborator

yt-dlp doesn't support invidious anyway, it just redirects to youtube

@264-bit
Copy link
Author

264-bit commented Jun 26, 2023

Yes, I understand it redirects invidious instances to youtube. I want to be able to add to the instances that it redirects to youtube, for example piped-material.ftp.sh, so I don't have to manually rewrite links myself.

@coletdjnz
Copy link
Member

coletdjnz commented Oct 7, 2023

Unless it goes through generic, It's not really feasible with an extractor arg as the valid url checking is done before the extractor is initialized (afaik). Also may not work with lazy loading.

I would say this is a job is best suited for a plugin.

Example plugin:

from yt_dlp.extractor.youtube import InfoExtractor


class YoutubeInvidiousRedirectIE(InfoExtractor):
    INVIDIOUS_URLS = (r'(?:www\.)?piped-material\.ftp\.sh',)
    _VALID_URL = r'https?://(?P<invidious_base>{})'.format('|'.join(INVIDIOUS_URLS))

    def _real_extract(self, url):
        invidious_base = self._match_valid_url(url).group('invidious_base')
        return self.url_result(url.replace(invidious_base, 'www.youtube.com'))

@coletdjnz coletdjnz added question Question and removed site-enhancement Feature request for some website triage Untriaged issue labels Oct 7, 2023
@pukkandan pukkandan closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question
Projects
None yet
Development

No branches or pull requests

4 participants