Мы уже знаем, что на текущую сессию интерпретатора изменение PYTHONPATH никак не повлияет. Но если вы запустите дочерний процесс, то он унаследует окружение текущего процесса, а значит и изменения в любых переменных будут на него влиять.
Вот небольшой пример:
Объявляем переменную
user@host:~$ export PYTHONPATH=/path1
Запускаем интерпретатор
user@host:~$ python3
Проверим что в sys.path
>>> import sys
>>> print(sys.path)
['', '/path1', '/usr/lib/...', ...]
Добавляем что-то в переменную
>>> import os
>>> os.emviron['PYTHONPATH'] = '/path1:/path2'
>>> print(sys.path)
['', '/path1', '/usr/lib/...', ...]
Изменений нет. Но давайте запустим дочерний процесс и посмотрим там
>>> os.system('python3')
# теперь мы находимся в другом процессе
>>> import sys
>>> print(sys.path)
['', '/path1', '/path2', '/usr/lib/...', ...]
Тоже самое будет и с subprocess, так как по умолчанию текущее окружение тоже наследуется.
>>> import subprocess
>>> subprocess.call(['python3', '-c', 'import sys;print(sys.path)'])
['', '/path1', '/path2', '/usr/lib/...', ...]
______________________
Лучшей практикой является передача энвайронмента явно через аргумент env!
import subprocess
subprocess.call(cmd, env={'PYTHONPATH': '...'})
Это поможет точно понимать какое окружение будет у запускаемого процесса и при этом не изменять окружение текущего процесса.
#basic
YouTube Downloaders
You can use any of these downloaders to download videos directly from ReVanced/ReVanced Extended
➖➖➖➖➖➖➖➖➖➖
Open Source Downloader
- NewPipe 0.25.1
- NewPipe x Sponsorblock 0.25.1
- Seal 1.9.2
- YTDLnis 1.6.1
- SpotiFlyer 3.6.3
➖➖➖➖➖➖➖➖➖➖
Close Source Downloader
- PowerTube 5.0.3
- DVD 0.1.5
- YMusic 3.7.16
- YouTube Downloader 8.1
➖➖➖➖➖➖➖➖➖➖
- Set downloader to RVX/RV
Join: @ReVanced_MMT
Discussion | Archive
#downloader
SpotiFLAC📱
Mobile port of SpotiFLAC written in Flutter, powered by a Go backend for high performance. Download Spotify tracks in true FLAC from Tidal, Qobuz, & Amazon Music — no ads, no subscription.
- 📥DLs:GitHub
- 🖥Preview
- 🧑💻SourceCode
❤️Follow us:@AndroBusket
📨 Tags: #android#downloader#music
Cobalt
A media downloader website that doesn't piss you off. it's fast, friendly, and doesn't have any bullshit that modern web is filled with: no ads, trackers, or invasive analytics.
paste the link, get the file, move on. it's that simple. just how it should be. You can host your own instance
• bilibili.com & bilibili.tv
• dailymotion videos
• instagram reels, posts & stories
• ok video
• pinterest videos & stories
• reddit videos & gifs
• rutube videos
• soundcloud
• streamable.com
• tiktok videos, photos & audio
• tumblr video & audio
• twitch clips
• twitter videos & voice
• vimeo
• vine archive
• vk video & clips
• youtube videos, shorts & music
cobalt is not affiliated with any services listed above.
this list is not final and keeps expanding over time, make sure to check it once in a while!
https://cobalt.tools
https://github.com/wukko/cobalt
https://status.cobalt.tools
https://github.com/wukko/cobalt/blob/current/docs/troubleshooting.md
Review:
This thing recodes sound to MP3 by default (more lossy distortion on top of whichever lossy codec like AAC the original video uses) which is a very bad idea. Also it processes files and gives its own server links even if the file is something like a YT video that can be downloaded off the original Google servers (with no transcoding whatsoever specified in settings).
And it's all lowercase
#web#video#downloader#yt
FluTube
Multiplatform Youtube video downloader made using flutter.
Features:
- Lightweight and fast
- No Login Required
- Keep your liked videos and comments
- Playlists support
- Download videos, audios and thumbnails
- Ad free forever
- Available for Windows/Linux/Android
- Free libre and open source (FLOSS)
Download - https://github.com/prateekmedia/flutube/releases
https://github.com/prateekmedia/flutube
#yt#YouTube#video#downloader
@foss_Android