simondaninja / youtube_rss Goto Github PK
View Code? Open in Web Editor NEWA YouTube-client for managing subscriptions and watching videos anonymously over Tor without a Google account.
License: GNU General Public License v3.0
A YouTube-client for managing subscriptions and watching videos anonymously over Tor without a Google account.
License: GNU General Public License v3.0
I've installed all dependencies yet I get errors:
I'm on NetBSD so I'm guessing that perhaps the paths are a bit mixed up?
$ sh youtube_rss.py
from: can't read /var/mail/html.parser: No such file or directory
youtube_rss.py: import: not found
youtube_rss.py: import: not found
youtube_rss.py: import: not found
youtube_rss.py: import: not found
from: can't read /var/mail/json: No such file or directory
from: can't read /var/mail/json: No such file or directory
youtube_rss.py: import: not found
youtube_rss.py: import: not found
youtube_rss.py: try:: not found
from: can't read /var/mail/tor_requests.tor_requests: No such file or directory
from: can't read /var/mail/tor_requests.tor_requests: No such file or directory
youtube_rss.py: except:: not found
youtube_rss.py: 36: Syntax error: Word "�you proba..." unexpected (expecting ")")
$ ./youtube_rss.py
Traceback (most recent call last):
File "./youtube_rss.py", line 24, in <module>
import requests as req
ModuleNotFoundError: No module named 'requests'
When searching for a video or channel, delete/backspace doesn't work.
I'm on MacOS 10.15.7
Upon refreshing subscriptions, very briefly, I get an error message:
I can't see the whole thing, but here is what it partially says:
refreshing subscriptions ... Process Process-2:
Traceback (most recent call last):
File "/usr/local/Cell
hona3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 315. in bootstrap self.run( )
Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 108, in run Fite /usr/Local/Cellar/pythonas. 9/3.9.5/Fram
self._target(*self._args, **self._wargs)
77 in refreshSubsriptionsByChannelss File "/Users/#####/youtube_rss/youtube_rss.py"
if USE THUMBNAILS:
NameError: name 'USE THUMBNAILS' is not defined
This program is starting to outgrow the single-file model. It worked really well up until I started doing threading, but now it is in need of reorganization.
On the fly, I improvised the following strategy just to quickly get some runtime stability, which is currently implemented. However, it is in need of improvement, and explicitly enforced formalization (only keeping it in my head leads to bugs):
I suggest that these be formalized in some way. At the very least, all functions that start a threaded process should be kept in a separate file, so that it becomes extra clear when a threaded process is started, and what takes place in the threaded process vs. the non-threaded process.
Also, right now there can be way to many threads at a time. I should implement a thread manager class, to do thread book-keeping. It should be relatively simple; make sure that a maximum of X threads are active at a time, and no fewer than that if needed. It should basically just be used as an interface to the thread class.
When getting search query html, you get redirected to a new consent page. Suggested solution is to analyze the forms on the page, and either accept tracking (since they will be discarded right away regardless, and this will probably be an easier solution), or to customize settings and disagree (which will take some more time but probably be better in the long run). Cookies are probably not an issue, since they can be instantly discarded. However, geolocation etc. is also sent in the form and might be an issue for users who are not using Tor.
To more easily locate the sources of bugs, I should implement some form of logging. I've done this on the fly sometimes, but it should be done in a more formalized fashion.
Look into how best to provide the project as a more easily usable/installable module.
Look into how the program can be made more compatible with and easily used on Windows. Perhaps take some inspiration from this commit on a fork by @christopherdoyle.
On Arch Linux, running commit 3166c53, I get the following error when trying to run youtube_rss.py
:
Traceback (most recent call last):
File "/home/matteas/youtube_rss/./youtube_rss.py", line 1281, in <module>
database = doWaitScreen('', parseDatabaseFile, DATABASE_PATH)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 410, in doWaitScreen
return curses.wrapper(doWaitScreenNcurses, message, waitFunction, *args, **kwargs)
File "/usr/lib/python3.9/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 419, in doWaitScreenNcurses
return waitFunction(*args, **kwargs)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 851, in parseDatabaseFile
with open(filename, 'r') as filePointer:
FileNotFoundError: [Errno 2] No such file or directory: '/home/matteas/.youtube_rss/database'
A quick workaround is to simply run touch ~/.youtube_rss/database
, which allows the script to run, but doesn't ultimately solve the issue. When trying to do anything with subscriptions, there are then inevitably errors because the program is trying to read from an empty file. Such as:
Traceback (most recent call last):
File "/home/matteas/youtube_rss/./youtube_rss.py", line 1284, in <module>
doStartupMenu(runtimeConstants)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 1151, in doStartupMenu
doMethodMenu("Do you want to use tor?", menuOptions, showItemNumber=False)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 1223, in doMethodMenu
result = methodMenuDecision.executeDecision()
File "/home/matteas/youtube_rss/./youtube_rss.py", line 326, in executeDecision
return self.function(*self.args, **self.kwargs)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 1209, in doMainMenu
doMethodMenu("What do you want to do?", menuOptions)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 1223, in doMethodMenu
result = methodMenuDecision.executeDecision()
File "/home/matteas/youtube_rss/./youtube_rss.py", line 326, in executeDecision
return self.function(*self.args, **self.kwargs)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 981, in doInteractiveChannelSubscribe
doMethodMenu(f"search results for '{query}', choose which " + \
File "/home/matteas/youtube_rss/./youtube_rss.py", line 1223, in doMethodMenu
result = methodMenuDecision.executeDecision()
File "/home/matteas/youtube_rss/./youtube_rss.py", line 326, in executeDecision
return self.function(*self.args, **self.kwargs)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 994, in doChannelSubscribe
database = doWaitScreen('', parseDatabaseFile, DATABASE_PATH)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 410, in doWaitScreen
return curses.wrapper(doWaitScreenNcurses, message, waitFunction, *args, **kwargs)
File "/usr/lib/python3.9/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 419, in doWaitScreenNcurses
return waitFunction(*args, **kwargs)
File "/home/matteas/youtube_rss/./youtube_rss.py", line 852, in parseDatabaseFile
return json.load(filePointer, cls = DatabaseDecoder)
File "/usr/lib/python3.9/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.9/json/__init__.py", line 359, in loads
return cls(**kw).decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I tried debugging it myself, but I don't know anything about waitFunction
and the rest of the code makes it a little unclear exactly what the database
file is supposed to look like. There's, uhh, no info in the README either, so I'm a little stuck. Figured I'd make an issue here instead of spending more time reverse engineering the code.
Any help is appreciated.
It would be convenient to have a section containing a history of videos played in the main menu.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.