Giter VIP home page Giter VIP logo

youtube-local's Introduction

youtube-local

screenshot youtube-local is a browser-based client written in Python for watching Youtube anonymously and without the lag of the slow page used by Youtube. One of the primary features is that all requests are routed through Tor, except for the video file at googlevideo.com. This is analogous to what HookTube (defunct) and Invidious do, except that you do not have to trust a third-party to respect your privacy. The assumption here is that Google won't put the effort in to incorporate the video file requests into their tracking, as it's not worth pursuing the incredibly small number of users who care about privacy (Tor video routing is also provided as an option). Tor has high latency, so this will not be as fast network-wise as regular Youtube. However, using Tor is optional; when not routing through Tor, video pages may load faster than they do with Youtube's page depending on your browser.

The Youtube API is not used, so no keys or anything are needed. It uses the same requests as the Youtube webpage.

Screenshots

Gray theme

Dark theme

Non-Theater mode

Channel

Downloads

Features

  • Standard pages of Youtube: search, channels, playlists
  • Anonymity from Google's tracking by routing requests through Tor
  • Local playlists: These solve the two problems with creating playlists on Youtube: (1) they're datamined and (2) videos frequently get deleted by Youtube and lost from the playlist, making it very difficult to find a reupload as the title of the deleted video is not displayed.
  • Themes: Light, Gray, and Dark
  • Subtitles
  • Easily download videos or their audio
  • No ads
  • View comments
  • Javascript not required
  • Theater and non-theater mode
  • Subscriptions that are independent from Youtube
    • Can import subscriptions from Youtube
    • Works by checking channels individually
    • Can be set to automatically check channels.
    • For efficiency of requests, frequency of checking is based on how quickly channel posts videos
    • Can mute channels, so as to have a way to "soft" unsubscribe. Muted channels won't be checked automatically or when using the "Check all" button. Videos from these channels will be hidden.
    • Can tag subscriptions to organize them or check specific tags
  • Fast page
    • No distracting/slow layout rearrangement
    • No lazy-loading of comments; they are ready instantly.
  • Settings allow fine-tuned control over when/how comments or related videos are shown:
    1. Shown by default, with click to hide
    2. Hidden by default, with click to show
    3. Never shown
  • Optionally skip sponsored segments using SponsorBlock's API
  • Custom video speeds
  • Video transcript
  • Supports all available video qualities: 144p through 2160p

Planned features

  • Putting videos from subscriptions or local playlists into the related videos
  • Information about video (geographic regions, region of Tor exit node, etc)
  • Ability to delete playlists
  • Auto-saving of local playlist videos
  • Import youtube playlist into a local playlist
  • Rearrange items of local playlist
  • Video qualities other than 360p and 720p by muxing video and audio
  • Corrected .m4a downloads
  • Indicate if comments are disabled
  • Indicate how many comments a video has
  • Featured channels page
  • Channel comments
  • Video transcript
  • Automatic Tor circuit change when blocked
  • Support &t parameter
  • Subscriptions: Option to mark what has been watched
  • Subscriptions: Option to filter videos based on keywords in title or description
  • Subscriptions: Delete old entries and thumbnails
  • Support for more sites, such as Vimeo, Dailymotion, LBRY, etc.

Installing

Windows

Download the zip file under the Releases page. Unzip it anywhere you choose.

Linux/MacOS

Download the tarball under the Releases page and extract it. cd into the directory and run

pip3 install -r requirements.txt

Note: If pip isn't installed, first try installing it from your package manager. Make sure you install pip for python 3. For example, the package you need on debian is python3-pip rather than python-pip. If your package manager doesn't provide it, try to install it according to this answer, but make sure you run python3 get-pip.py instead of python get-pip.py

  • Arch users can use the AUR package maintained by @ByJumperX4
  • RPM-based distros such as Fedora/OpenSUSE/RHEL/CentOS can use the COPR package maintained by @ByJumperX4

FreeBSD

If pip isn't installed, first try installing it from the package manager:

pkg install py39-pip

Some packages are unable to compile with pip, install them manually:

pkg install py39-gevent py39-sqlite3

Download the tarball under the Releases page and extract it. cd into the directory and run

pip install -r requirements.txt

Note: You may have to start the server redirecting its output to /dev/null to avoid I/O errors:

python3 ./server.py > /dev/null 2>&1 &

Usage

To run the program on windows, open run.bat. On Linux/MacOS, run python3 server.py.

Note for Mac users: If you installed Python from the installer on python.org, you will need to have run the file Install Certificates.command in the directory Applications/Python 3.x where x is the minor version of python. Otherwise, you will get the error certificate verify failed: unable to get local issuer certificate. There is a similar file in that directory you can run to get the python3 command installed for the terminal.

To run it at startup on Windows, right click run.bat and click "Create Shortcut." Then, move the shortcut to the Startup folder. You can access the Startup folder by pressing Windows Key + R and typing shell:startup.

Access youtube URLs by prefixing them with http://localhost:8080/, For instance, http://localhost:8080/https://www.youtube.com/watch?v=vBgulDeV2RU You can use an addon such as Redirector (Firefox|Chrome) to automatically redirect Youtube URLs to youtube-local. I use the include pattern ^(https?://(?:[a-zA-Z0-9_-]*\.)?(?:youtube\.com|youtu\.be|youtube-nocookie\.com)/.*) and the redirect pattern http://localhost:8080/$1 (Make sure you're using regular expression mode).

If you want embeds on the web to also redirect to youtube-local, make sure "Iframes" is checked under advanced options in your redirector rule.

youtube-local can be added as a search engine in firefox to make searching more convenient. See here for information on firefox search plugins.

Portable mode

If you wish to run this in portable mode, create the empty file "settings.txt" in the program's main directory. If the file is there, settings and data will be stored in the same directory as the program. Otherwise, settings and data will be stored in C:\Users\[your username]\.youtube-local on Windows and ~/.youtube-local on Linux/MacOS.

Using Tor

In the settings page, set "Route Tor" to "On, except video" (the second option). Be sure to save the settings.

Ensure Tor is listening for Socks5 connections on port 9150. A simple way to accomplish this is by opening the Tor Browser Bundle and leaving it open. However, you will not be accessing the program (at https://localhost:8080) through the Tor Browser. You will use your regular browser for that. Rather, this is just a quick way to give the program access to Tor routing.

Standalone Tor

If you don't want to waste system resources leaving the Tor Browser open in addition to your regular browser, you can configure standalone Tor to run instead using the following instructions.

For Windows, to make standalone Tor run at startup, press Windows Key + R and type shell:startup to open the Startup folder. Create a new shortcut there. For the command of the shortcut, enter "C:\[path-to-Tor-Browser-directory]\Tor\tor.exe" SOCKSPort 9150 ControlPort 9151. You can then launch this shortcut to start it. Alternatively, if something isn't working, to see what's wrong, open cmd.exe and go to the directory C:\[path-to-Tor-Browser-directory]\Tor. Then run tor SOCKSPort 9150 ControlPort 9151 | more. The more part at the end is just to make sure any errors are displayed, to fix a bug in Windows cmd where tor doesn't display any output. You can stop tor in the task manager.

For Debian/Ubuntu, you can sudo apt install tor to install the command line version of Tor, and then run sudo systemctl start tor to run it as a background service that will get started during boot as well. However, Tor on the command line uses the port 9050 by default (rather than the 9150 used by the Tor Browser). So you will need to change Tor port to 9050 and Tor control port to 9051 in the youtube-local settings page. Additionally, you will need to enable the Tor control port by uncommenting the line ControlPort 9051, and setting CookieAuthentication to 0 in /etc/tor/torrc. If no Tor package is available for your distro, you can configure the tor binary located at ./Browser/TorBrowser/Tor/tor inside the Tor Browser installation location to run at start time, or create a service to do it.

Tor video routing

If you wish to route the video through Tor, set "Route Tor" to "On, including video". Because this is bandwidth-intensive, you are strongly encouraged to donate to the consortium of Tor node operators. For instance, donations to NoiseTor go straight towards funding nodes. Using their numbers for bandwidth costs, together with an average of 485 kbit/sec for a diverse sample of videos, and assuming n hours of video watched per day, gives $0.03n/month. A $1/month donation will be a very generous amount to not only offset losses, but help keep the network healthy.

In general, Tor video routing will be slower (for instance, moving around in the video is quite slow). I've never seen any signs that watch history in youtube-local affects on-site Youtube recommendations. It's likely that requests to googlevideo are logged for some period of time, but are not integrated into Youtube's larger advertisement/recommendation systems, since those presumably depend more heavily on in-page tracking through Javascript rather than CDN requests to googlevideo.

Importing subscriptions

  1. Go to the Google takeout manager.
  2. Log in if asked.
  3. Click on "All data included", then on "Deselect all", then select only "subscriptions" and click "OK".
  4. Click on "Next step" and then on "Create export".
  5. Click on the "Download" button after it appears.
  6. From the downloaded takeout zip extract the .csv file. It is usually located under YouTube and YouTube Music/subscriptions/subscriptions.csv
  7. Go to the subscriptions manager in youtube-local. In the import area, select your .csv file, then press import.

Supported subscriptions import formats:

  • NewPipe subscriptions export JSON
  • Google Takeout CSV
  • Old Google Takeout JSON
  • OPML format from now-removed YouTube subscriptions manager

Contributing

Pull requests and issues are welcome

For coding guidelines and an overview of the software architecture, see the HACKING.md file.

License

This project is licensed under the GNU Affero General Public License v3 (GNU AGPLv3) or any later version.

Permission is hereby granted to the youtube-dl project at https://github.com/ytdl-org/youtube-dl to relicense any portion of this software under the Unlicense, public domain, or whichever license is in use by youtube-dl at the time of relicensing, for the purpose of inclusion of said portion into youtube-dl. Relicensing permission is not granted for any purpose outside of direct inclusion into the official repository of youtube-dl. If inclusion happens during the process of a pull-request, relicensing happens at the moment the pull request is merged into youtube-dl; until that moment, any cloned repositories of youtube-dl which make use of this software are subject to the terms of the GNU AGPLv3.

Donate

  • Bitcoin: bc1qnxfm8mk2gdcdr56308794a4f97dd7wu6qawguw
  • Monero: 469tczUEVTX6Y7bMEgTyrUJ2K7R8qVNjn5eh5VVHKvi4QsbMD7vrFW8RaCqM1jmZMR9GM87yByvPKZb8gsSxUzrdGCM1yXv
  • Ethereum: 0x04828FFa6fa8F68535A22153300e50AfCDC342C4

Similar projects

youtube-local's People

Contributors

atagmester avatar brawl345 avatar david-jonesdvn avatar j4ln avatar jellelicht avatar senchpimy avatar user234683 avatar user234684 avatar user938120 avatar zrose584 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

youtube-local's Issues

Could not view comment replies

Whenever I try to view replies to any comment a 500 Uncaught exception would come up instead of the replies.

Steps to reproduce:

  1. Go to any video (Here's an example)
  2. Click on the replies of any comment

youtube-local version: 2.5.4
OS: macOS 11.2.1

Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/akbarfadi01/program_files/youtube-local/youtube/comments.py", line 195, in get_comments_page
    comments_info = yt_data_extract.extract_comments_info(request_comments(ctoken, replies))
  File "/Users/akbarfadi01/program_files/youtube-local/youtube/comments.py", line 69, in request_comments
    content = util.fetch_url(
  File "/Users/akbarfadi01/program_files/youtube-local/youtube/util.py", line 308, in fetch_url
    raise FetchError(str(response.status), reason=response.reason,
youtube.util.FetchError: HTTP error during request: 500 Internal Server Error

Error: Could not find player

Hi,
I am recently getting the following Error: Could not find player (see screenshot)
youtube-local-error
There are no error-messages in the console. The error is not persistent so after a couple of Tor-restarts (I am routing through tor) everything works fine again (until it doesn't)
If you need any more information (like the youtube-local-configuration), I can of course provide you with that.
If you know how to fix that would be awesome, I really enjoy using this project :)

I can't change page on some channels

Whenever I try to change pages in a channel, show me an error a 500 Uncaught exception

Steps to reproduce:

youtube-local version: 2.5.4
OS: Debian Buster

Traceback

Traceback (most recent call last):
File "/home/liberate/venv/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request()
File "/home/liberate/venv/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e)
File "/home/liberate/venv/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb)
File "/home/liberate/venv/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise raise value
File "/home/liberate/venv/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request()
File "/home/liberate/venv/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args)
File "/home/liberate/youtube/channel.py", line 273, in get_channel_page return get_channel_page_general_url('https://www.youtube.com/channel/' + channel_id, tab, request, channel_id)
File "/home/liberate/youtube/channel.py", line 224, in get_channel_page_general_url util.check_gevent_exceptions(*tasks)
File "/home/liberate/youtube/util.py", line 542, in check_gevent_exceptions raise task.exception
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "/home/liberate/youtube/channel.py", line 127, in get_channel_tab debug_name='channel_tab', report_text=message)
File "/home/liberate/youtube/util.py", line 318, in fetch_url ip=None) youtube.util.FetchError: HTTP error during request: 500 Internal Server Error 

Running in Docker

I was trying to run youtube-local on Docker. While the container starts and there are some signs that the app is running internally, I couldn't access it through localhost:8080. I'm not quite sure if there's something I did wrong (I'm very new to docker) or it's just something from youtube-local itself.

Dockerfile:

FROM python:3.8-alpine
RUN apk add musl-dev build-base gcc libffi-dev python3-dev
COPY . .
RUN pip3 install -r requirements.txt
EXPOSE 8080
CMD ["python3", "server.py"]

Run commands : docker run -dp 8080:8080 youtube-local

I find this project interesting and I would like to contribute where can I start?

I recently stumbled upon youtube-local and I think the project is neat and I would like to contribute.
Whoever I have absolutely no idea how the code works (the structure). It would be nice if I could get a little explanation on how the project's code is structure and where can I start reading the code to understand it.

Just as background info that may help I'm a computer science college student. I'm familiar with python. I've also been doing projects and coding assignments from school but it seems that understanding code written by someone is harder than expected especially when I wasn't there to see how the code was put together.

Method to add current video to playlist (checkbox underneath) is unintuitive

Here is my method for adding a video to a playlist, perhaps I am doing something wrong. Lets say I am currently watching a video (so I am at the /watch endpoint). I type the name of the playlist I want to add the current video to into the bar next to the "add to playlist" button. A message appears that says the video has been added to the playlist, but when I go to view the playlist it is empty. The file used for storing playlist date (ex music.txt) is created, but is empty.

I have to run pip3 install -r requirements.txt more than once

Hi.

I downloaded the latest version (2.6.0) last night and extracted it to its own folder (youtube-local-2.6.0). After that, I created the settings.txt file to make it portable and ran pip3 install -r requirements.txt. After this, I ran python3 server.py. Everything worked. Perfect! I stopped the service and killed the port.

But after a good night of sleep, I ran python3 server.py again and got sqlite3.OperationalError: unable to open database file as an error. I ran pip3 install -r requirements.txt again and then python3 server.py. Worked perfectly.

So, now to my question. Why do I have to run pip3 install -r requirements.txt command more than once?

This issue were not present when I used an older version of youtube-local. I didn't use portable mode back then because it didn't work despite I had created the settings.txt file after I had used youtube-local a few times before (I suspect this has to be due to caching).

Some video files fail to load at 720p, with 503 error

Sometimes googlevideo.com/videoplayback URLs fail with 503 error code.

  • This only happens on a subset of videos, but for these it's reproducible for several days (or longer).
  • I've encountered the issue at 720p, but haven't seen it happen at 360p.

I looked into it a bit, and found that different browsers report the failure differently. Waterfox doesn't give any errors in the network console, just says the video format isn't supported. Firefox displays a 503 on one of the requests. Ungoogled chromium puts (failed) in place of the status, with a tooltip of "net::ERR_CONTENT_LENGTH_MISMATCH".

For a sample video with the problem, when I wget the URL, it gives "Read error at byte 111496/138135408 (The TLS connection was non-properly terminated.)" and then retries. I doubt the server is actually returning a 503 code, I think the browser/tools are just putting that there as a placeholder. With wget, I noticed for that video that it always fails twice at the same byte positions: 111496 and 372692, which are very early into the file, even with different exit nodes or not using tor. Inspecting these positions in a hex editor, there are repeating units of 00 00 01 ** where ** is some arbitrary byte. Further into the video file is presumably the video data which is much more random looking. I'll have to investigate the mp4 format more deeply. Since this is a TLS error, it will also be worth taking a look at what happens in Wireshark.

As a temporary workaround, I'll try getting video and audio stream muxing with MediaSource working when I get some time, since the error doesn't seem to happen with the video-only urls.

[Request] Add SponsorBlock support

Hello and first let me thank you for making youtube usable again (it became bloated and laggy after they retired the old interface). But, nowadays, certain content creators abuse in the video ads, so i find the sponsorblock extension a must to watch youtube videos.
So, is it possible to implement the sponsorblock ad skipping in the embedded video player?
Kodi has an addon for this, but i don't know how easy it would be to implement in your app:
https://github.com/ajayyy/SponsorBlock/wiki/3rd-Party-Ports#kodi

My current workaround is to use invidious with the sponsorblock extension (which supports invidious instances), but I much prefer your app, because it's much more reliable.
If it's too hard or too much work, thank you very much nonetheless, because it's an excellent tool that made youtube bearable for me (and I'm sure for a lot of other people).

Getting permission denied errors for /run/tor/control.authcookie

EDIT 1: As it turns out, there is not a new identity being acquired. I was seeing this on random auto-checks for subscriptions, whereas now I'm actually using the search feature, and catching this error, and the exit node is not changed.


EDIT 2: So I had my CookieAuthentication set to 1 instead of 0 in my torrc file. I believe this was the cause of my issue. I'm going to leave this open for a bit just to be sure that this was actually the root of the problem.


According to the log, it appears that there is a new identity acquired, but~~ there is a permissions error happening, and I don't know if it matters....

Error: Youtube blocked the request because the Tor exit node is overutilized. Exit node IP address: 89.163.154.91
new_identity: new_identity called
new_identity: New identity lock acquired
Traceback (most recent call last):
  File "/home/ryan/.local/lib/python3.8/site-packages/stem/connection.py", line 1103, in _read_cookie
    with open(cookie_path, 'rb', 0) as f:
PermissionError: [Errno 13] Permission denied: '/run/tor/control.authcookie'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
  File "/home/ryan/Downloads/youtube-local-2.5.8/youtube/channel.py", line 229, in get_channel_first_page
    return util.fetch_url(base_url + '/videos?pbj=1&view=0', headers_desktop,
  File "/home/ryan/Downloads/youtube-local-2.5.8/youtube/util.py", line 309, in fetch_url
    error = tor_manager.new_identity(start_time)
  File "/home/ryan/Downloads/youtube-local-2.5.8/youtube/util.py", line 130, in new_identity
    controller.authenticate('')
  File "/home/ryan/.local/lib/python3.8/site-packages/stem/control.py", line 1112, in authenticate
    stem.connection.authenticate(self, *args, **kwargs)
  File "/home/ryan/.local/lib/python3.8/site-packages/stem/connection.py", line 629, in authenticate
    raise auth_exc
  File "/home/ryan/.local/lib/python3.8/site-packages/stem/connection.py", line 591, in authenticate
    authenticate_safecookie(controller, cookie_path, False)
  File "/home/ryan/.local/lib/python3.8/site-packages/stem/connection.py", line 904, in authenticate_safecookie
    cookie_data = _read_cookie(cookie_path, True)
  File "/home/ryan/.local/lib/python3.8/site-packages/stem/connection.py", line 1107, in _read_cookie
    raise UnreadableCookieFile(exc_msg, cookie_path, is_safecookie)
stem.connection.UnreadableCookieFile: Authentication failed: unable to read '/run/tor/control.authcookie' ([Errno 13] Permission denied: '/run/tor/control.authcookie')
2021-07-22T03:09:42Z <Greenlet at 0x7fabcbe3bbf0: get_channel_first_page(channel_id='UCRE3NFNtdjR96-H4QG4U1Fg')> failed with UnreadableCookieFile

Again, I don't know if this matters if the new identity is created/acquired, but I figured I'd bring it up.

Any way to run this on 32 bit Windows?

The new Youtube layout is slow as snails on older computers. This looks like a really nice alternative, so wondering if there is any way to make this run on 32 bit Windows? Or maybe I could compile it myself?

Responsive front-end

Hi,

I recently discovered this app and so far it's been awesome. I recently tried to access it on my phone and noticed that the front-end was not mobile friendly at all.

I think it would great to add a bit of CSS/HTML code for the app to be responsive.

Thank you for the app,

Some older videos are stuck in subscriptions list

Since some days ago, I'm having an annoying problem: a few videos that are shown before newer ones in my subscriptions list
I think a screenshot would be better than a long and boring explanation of the problem
image

plyr and shortcuts

I just noticed some shortcuts don't work anymore after 1e65153.

So I looked at it and saw hotkeys.js is disabled in favor of plyr builtin(?) shortcuts.
Why is that? Why not always rely on hotkeys.js, and disable plyr's shortcuts?

In case that's not possible one could expose settings.video_player as js variable, which is read in hotkeys.js and disables some (but not all!) hotkeys.

[Feature] Easily switch quality

As for now you can only choose and watch other video qualities if you click on download and the link.
It would be much more convenient if you can directly choose the quality on the video page itself, or atleast increase the default quality in the settings

Feature request : playlist download

It would be nice to have a way to download a complete playlist like we can do with one video, you choose the quality, audio only, video only or both, and then it downloads everything. I have my music playlist in youtube-local but it's long as hell to download one music by one. There are some online downloaders for youtube playlist, but there is no way for youtube-local playlists, which are not on youtube.

New exit-node-blocking errors

YouTube rolled out very aggressive IP-blocking this month and most exit nodes are blocked most of the time, making Tor-routing nearly unusable. However, the new type of blocking (which doesn't include the IP address in the page) only applies to the watch page. I can't devote much time to the issue at the moment but here's some ideas, if anyone wants to help with them,

  • Reverse-engineer the API that the YouTube app uses and pretend to be the YouTube app when requesting the video data (since this blocking apparently doesn't apply to the app).
  • Use some sort of automated captcha solver such as buster. I imagine this would require a headless browser to work which might defeat the purpose
  • Some kind of paid captcha service like invidious and similar use. I'm not sure how this would work with having independent clients rather than a central service or how the funds would be managed.

Join projects

Hey! I've seen your project and it is pretty nice! I would like to talk to you about joining skills and forces to develop a solution together. Would you like to contribute to Yotter? We could use our codes and join parts together so we can offer a good and robust solution. What do you say?

Separate Tor circuits for checking subscriptions

Subscriptions are unique per user. They should be done in a separate circuit so they cannot be associated with what videos are being watched. Need to figure out how to do this, preferably without bundling Tor ourselves.

Research:

  • Are any special APIs provided by the Tor Socks5 proxy? Does "Tor RC" have anything to do with it or is that strictly the configuration file?
  • If not, what libraries/APIs are available and what is the recommended way to integrate with them?

Search in channel not working

Searching videos in the channel page doesn't work but only if the channel url is in the https://www.youtube.com/channel/UCxxxxx format. If the URL is something like https://www.youtube.com/c/SomeChannelName then the search works as expected.

Example:
http://localhost:8080/https://www.youtube.com/channel/UC5I2hjZYiW9gZPVkvzM8_Cw/search?query=minidisc - doesn't work
http://localhost:8080/https://www.youtube.com/c/Techmoan/search?query=minidisc - works

Traceback:

Traceback (most recent call last):
  File "C:\Users\akbar\bin\youtube-local\python\lib\site-packages\flask\app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\akbar\bin\youtube-local\python\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\akbar\bin\youtube-local\python\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Users\akbar\bin\youtube-local\python\lib\site-packages\flask\_compat.py", line 39, in reraise
    raise value
  File "C:\Users\akbar\bin\youtube-local\python\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\akbar\bin\youtube-local\python\lib\site-packages\flask\app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Users\akbar\bin\youtube-local\youtube\channel.py", line 289, in get_channel_page
    return get_channel_page_general_url('https://www.youtube.com/channel/' + channel_id, tab, request, channel_id)
  File "C:\Users\akbar\bin\youtube-local\youtube\channel.py", line 256, in get_channel_page_general_url
    polymer_json = get_channel_search_json(channel_id, query, page_number)
  File "C:\Users\akbar\bin\youtube-local\youtube\channel.py", line 195, in get_channel_search_json
    polymer_json = util.fetch_url("https://www.youtube.com/browse_ajax?ctoken=" + ctoken, headers_desktop, debug_name='channel_search')
  File "C:\Users\akbar\bin\youtube-local\youtube\util.py", line 319, in fetch_url
    ip=None)
youtube.util.FetchError: HTTP error during request: 404 Not Found

Double slashes get replaced with a single slash in some environments

Hello! I was testing this app on Google's Cloud Shell which runs web apps by proxying their ports to port 80 into a URL:

https://8080-8be694f9-38c9-4de2-8d54-cf17a257f2cd.europe-west4.cloudshell.dev/https://youtube.com

I noticed that double slashes get replaced with a single slash and I am not sure where the fault is -- Google or youtube-local

Screenshot_1

Suggestion: Can we skip the protocol part altogether in future versions as I don't think it's essential to the functioning of the app?

URLs without the protocol somewhat work, although no resources (images, videos) load.

image

Bunch of 404s in the console:

image

Replace youtube URLs in description of videos with youtube-local URLs

In the description of a video open in youtube-local, any hyperlinks are displayed as is, even links to other YouTube videos. This means that clicking on one of these links will drag you into the actual YouTube frontend.
It would be nice to have the href changed so you stay on youtube-local.

Change font

That serif font looks hideous for this purpose. What's an easy way to change it?

Alternatively, just officially change the program to use a sans-serif font, it will look much better,

#49 not to be closed

I may have not explained the #49 issue with the right words, but I have the same videos stuck above all others for weeks now. Every new video gets below 6 videos that I have already seen in my subscription list

how server usage?

Hello dear developer, how can I configure the application with gunicorn or uwsgi?

Audio-only mode

It would be nice if there's a mode where it'll stream only the audio instead of with the video. It saves huge amounts of bandwidth when you're just trying to listen to music. Currently the workaround is to open one of the download links in a new tab and play it from the tab.

One way to implement this is something like in Invidious where there's a button to switch between video and audio mode and an option to force audio only by default.

Example video: https://invidious.snopyta.org/watch?v=gDHJ6nBdLD8&listen=1

Audio mode OFF (the headphone button is used to switch between audio and video mode)

Audio mode ON (the player is just showing the thumbnail)

RFC: Most wanted bugfixes and features

I'll have some time mid-december to work more on youtube-local. Comment here with what bugfixes or features you think I should prioritize. If another comment suggests what you want, just add a thumbs up to it. I'm most interested in addressing things that are daily annoyances or that create friction, such as blocked exit nodes

About javascript

I really like this project.
But I think a little javascript could improve "QoL"..
I think of the following:

  • ability to jump to timestamps (e.g. 14:31)
  • lazy loading of comments (-> faster /watch page load)
  • load more comments while staying on the /watch site.
  • hotkeys (e.g. 'k' for pause etc.)

In case you want to preserve "Works without Javascript" as a feature, all this could be made optionally.
What do you think?

Http post request for commenting videos

Hello there! I just found your project on Github and I have some questions, could you please answer it? :)
I just trying to make a software which will use browser cookies and leave comments under youtube videos and I cant figure out how to do it using http requests. So I founded your project and I cant authorize youtube accounts.
Please if you have free time, could you add me in skype and help me with making post requests for adding comments on youtube videos?
I want to comment videos using Node JS or Http requests using browser cookies without official youtube api

Migration issue

I want to import all my subscription list from YouTube or Newpipe but there is no easy way to do that I have to manually subscribe to the individual channel. Please Help

404 Errors

Cloned repo today, got this issue:
127.0.0.1 - - [2018-07-31 16:10:08] "GET /https://www.youtube.com/ HTTP/1.1" 404 114 0.000179

I tried the regular way from the address bar, I also tried via Redirector. Same issue.

hide (full) description by default

yt.com seems to allow up to 5000 characters in the video description.
I see the following variations:

  • a "show more" / "show less" feature
    • implemented fully in .js
    • OR: define the "teaser" section via jinja.
  • OR: just use another <details> element

Maybe after the description is less long, the Downloads <details> Element can be moved below the description.

Error: Error decrypting url signatures: Could not find player name

Having problems playing THIS video on archlinux

using Error: Error decrypting url signatures: Could not find player name

https://www.youtube.com/watch?v=gRhAPXJmm2c

if it matters, im using port 8081

hgeres error log from when it happens

127.0.0.1 - - [2021-02-02 08:18:48] "GET /https://r5---sn-hp57yne7.googlevideo.com/videoplayback?expire=1612293516&ei=LFEZYL7iIouUhwbJg7iAAw&ip=[XXX.XXX.XXX.XXX]&id=o-AMF7ULSizyPhQgnSrTKsYMDumgH_0nEQEUN-GYXRe4KB&itag=22&source=youtube&requiressl=yes&mh=iT&mm=31%2C29&mn=sn-hp57yne7%2Csn-hp57knz6&ms=au%2Crdu&mv=m&mvi=5&pl=16&gcr=us&initcwndbps=2151250&vprv=1&mime=video%2Fmp4&ns=FLcVac1YP6PtNfSRyfpg7o4F&cnr=14&ratebypass=yes&dur=245.968&lmt=1472212170500621&mt=1612271575&fvip=6&c=MWEB&n=qBikUebZeTGjxndqc&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhALR1nfFLR0u-PJaJXkzFeVQbl3T5RuCpRGipTF1wffYBAiBdDKTXMVELLa5X03LqnrIdQMtNLKkIukEouAXYxiaM9A%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgLCJ0Qt6EyPrrcoRHiqtjouOYArO4vMND3OwBxbA3lrsCIQCmwKIAgLlVayqb3ghWVm-hYF1q4DX8B-vm5iBXBMtV5A%3D%3D HTTP/1.1" 206 47531332 10.450338
Retrieved comments Latency: 0.757 Read time: 0.0
127.0.0.1 - - [2021-02-02 08:35:11] "GET /https://www.youtube.com/watch?v=-rUaC5G9uY8 HTTP/1.1" 200 86607 0.840325
Retrieved comments Latency: 0.395 Read time: 0.004
127.0.0.1 - - [2021-02-02 08:35:25] "GET /https://www.youtube.com/watch?v=-rUaC5G9uY8 HTTP/1.1" 200 86782 0.688076
127.0.0.1 - - [2021-02-02 08:35:25] "GET /youtube.com/static/favicon.ico HTTP/1.1" 200 5979 0.000980

Play local playlists

It would be great if instead of just being a "videos folder" we could play the entire playlist, shuffle it and loop it (to make the playlist restart when it reaches its end).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.