Первая директория в sys.path
🔸 Когда вы запускаете Python-интерпретатор в интерактивном режиме, в системные пути (sys.path) в самое начало добавляется текущая рабочая директория
>>> for path in sys.path:
... print(f'"{path}"')
""
"/usr/lib/python37.zip"
"/usr/lib/python3.7"
...
Первая строка пустая, что и означает текущую рабочую директорию.
🔸 Если вы запускаете интерпретатор передавая скрипт как аргумент, то история получается иная. На первом месте будет директория в которой располагается скрипт. А текущая рабочая директория игнорируется.
Пишем скрипт с таким содержанием:
# script.py
import sys
for path in sys.path:
print(f'"{path}"')
Запускаем
python3 /home/user/dev/script.py
Получаем
"/home/user/dev"
"/usr/lib/python37.zip"
"/usr/lib/python3.7"
...
🔸 Если вы запускаете скрипт по имени модуля то на первом месте будет домашняя директория текущего юзера
python3 -m script
"/home/user"
"/usr/lib/python37.zip"
"/usr/lib/python3.7"
...
Скрипт должен быть доступен для импорта
На что это влияет?
На видимость модулей для импорта. Если вы ждёте, что, запустив скрипт по пути, сможете импортировать модули из текущей рабочей директории, то вы ошибаетесь. Придётся добавлять путь os.getcwd() в sys.path самостоятельно или заранее объявлять переменную PYTHONPATH.
#basic
Morphe
https://morphe.software
https://github.com/MorpheApp
Morphe is an Android app modification tool.
It allows you to change how apps work, look, and behave beyond their original design.
Build new functionality, remove limitations, and tailor apps to your needs.
For now it supports these censored apps: YouTube, YouTube Music or Reddit.
You should boycott them, but if you are used by those propaganda apps, at least you could remove the unwanted ads
Morphe is an independent project based on prior work from ReVanced.
#yt
⚡️You-Get: Download video, audio, images from the web easily!
Ever wanted to pull a bunch of content down so you can watch later?
You-Get is a CLI (command line interface) utility that makes it easy to download videos, audio, and images from the web.
https://you-get.org
you-get 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
You Get supports an impressive array of sites: Youtube, Twitter, VK, Tumblr, Soundcloud, Instagram, Facebook, and countless others!
It supports downloading YouTube playlists as well, it'll go through each video in the playlist.
Downloads can be very slow though, I recommend you use the —info flag before downloading to see what formats are available. Then you can run the command again with the —i-tag flag at whichever quality level is right for you.
You can download videos off of big tech platforms / paywalls by using the '—cookies' flag and pointing to a Firefox cookies database (cookies.sqlite).
Alternative: https://ytdl-org.github.io/youtube-dl/
🫶@takebackourtech
#yt
#NewPipe on #Linux, Using Android_translation_layer
https://flathub.org/apps/net.newpipe.NewPipe
Comments
https://news.ycombinator.com/item?id=41963932
#yt
yt-fts - YouTube Full Text Search
https://github.com/NotJoeMartinez/yt-fts
yt-fts is a command line program that uses yt-dlp to scrape all of a #YouTube channels #subtitles and load them into a sqlite database that is searchable from the command line. It allows you to query a channel for specific key word or phrase and will generate time stamped YouTube urls to the video containing the keyword.
It also supports semantic search via the OpenAI embeddings API, Gemini embedding API and using chromadb.
Blog Post
LLM/RAG Chat Bot
Video Summaries
Semantic Search
CHANGELOG
Installation:
pip install yt-fts
#yt
SmartTube
Advanced player for set-top boxes and tvs running Android OS
Features
No Ads
Designed for TV screens
Up to 8K video resolution
Login into your account
Cast from the phone
Support tv box remote controller
Support external software keyboard
Support devices without Google Services
Open source
https://smarttubeapp.github.io
https://github.com/yuliskov/SmartTube
https://github.com/yuliskov/SmartTube/releases
WARNING NOT FULLY OPEN SOURCE
There are at least 5 proprietary libraries in the app.
https://github.com/yuliskov/SmartTube/issues/471
* Crashlytics (/com/crashlytics): Tracking
* Firebase Data Transport (/com/google/android/datatransport): NonFreeNet
* Google Mobile Services (/com/google/android/gms): NonFreeDep
* Firebase (/com/google/firebase): NonFreeNet,NonFreeDep
* Firebase Analytics (/com/google/firebase/analytics): Tracking
IzzySoft:
The 5 offenders are not permitted at F-Droid (and before you ask: I wouldn't take it into my repo either unless at least Crashlytics and Firebase Analytics are removed; 5 non-free libraries is a bit much for free/libre software).
#video#yt#androidtv
Latest release Freetube - An electron Youtube client that blocks ads (but can't avoid Google's YouTube censorship) now comes with support for sponsorblock
https://github.com/FreeTubeApp/FreeTube/releases/tag/v0.13.0-beta
#freetube#yt#YouTube