Owczar
10 Październik 2021 20:42
#1
Cześć,
Na mojej bramce DEV3 pojawia się problem przerywania dźwięku co ok 25 sek na jakieś 5sek. Pasek idzie do przodu, dzwięk ustaje, a po chwili wraca te 5 sek do tyłu i zaczyna grać. Bramka podpięta optykiem do amplitunera. Wiele zależy od utworu.
Zrobiłem nawet update bramki, ale bez zmian…
Podczas odtwarzania radia nie ma tego problemu. Czasem problem ustaje na jakiś czas, ale wraca. W logach nie widać błędów. Gdzie mogę poszukać logów dotyczących samego media playera?
1 polubienie
Owczar
11 Październik 2021 13:13
#2
Podpowie ktoś jak działa media extractor? Gdzie można sprawdzić config lub go zmienić?
Dawno nic mnie tak nie irytowało jak przerywająca muzyka…
Owczar
11 Październik 2021 13:19
#4
Dzięki. To widziałem, ale by default nie ma configu dla media extractora w configuration.yaml stąd moje poszukiwania w jaki sposób jest to odpalane.
Rozumiem, że jak dodam wpis to obowiazujący będzie config, który mu podam?
Owczar
11 Październik 2021 13:31
#5
Wpis jak niżej rozwiązał problem:
media_extractor:
default_query: bestaudio[ext=m4a]/bestaudio[ext=ogg]/bestaudio
1 polubienie
jolka
11 Październik 2021 13:35
#6
tak, tak właśnie możesz nadpisać naszą konfigurację
super
paciuk
11 Październik 2021 15:42
#7
Tak zapytam. Jak się uruchamia YouTube na bramce? Czy muszę zainstalować YouTube z poziomu android na bramce?
Owczar
12 Październik 2021 07:58
#8
Ja używam tylko do odtwarzania muzyki. Wystarczy wpisać youtube i nazwa utworu.
Taka funkcjonalnosc jest juz wbudowana.
Ograniczyłeś się do audio (zapewne nie korzystasz z video na bramce) więc nieco zmniejszyłeś transfer i mieścisz się z buforem w limicie wprowadzonym przez youtube ~80kB/s.
Ale czy na pewno nie przycina przy każdym źródle?
Od jakiegoś czasu mają z tym problem wszystkie popularne youtube-downloader’y, bo wyliczanie nowego parametru “n” nie jest takie proste. Jest nawet fork do youtube-dl’a o nazwie yt-dlp, w którym ten problem tymczasowo rozwiązali poprzez podszywanie się jako klient Android’a - działa, ale nie wiadomo jak długo.
Na szczęście wczoraj pojawił się pull request do youtube-dl (używany przez media_extractor) rozwiązujący problem throttling’u:
ytdl-org:master
← dirkf:df-youtube-unthrottle-patch
opened 06:00AM - 01 Nov 21 UTC
## Please follow the guide below
---
### Before submitting a *pull request… * make sure you have:
- [x] [Searched](https://github.com/ytdl-org/youtube-dl/search?q=is%3Apr&type=Issues) the bugtracker for similar pull requests
- [x] Read [adding new extractor tutorial](https://github.com/ytdl-org/youtube-dl#adding-support-for-a-new-site)
- [x] Read [youtube-dl coding conventions](https://github.com/ytdl-org/youtube-dl#youtube-dl-coding-conventions) and adjusted the code to meet them
- [x] Covered the code with tests (note that PRs without tests will be REJECTED)
- [x] Checked the code with [flake8](https://pypi.python.org/pypi/flake8)
### In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under [Unlicense](http://unlicense.org/). Check one of the following options:
- [x] I am the original author of this code and I am willing to release it under [Unlicense](http://unlicense.org/)
- [ ] I am not the original author of this code but it is in public domain or released under [Unlicense](http://unlicense.org/) (provide reliable evidence)
### What is the purpose of your *pull request*?
- [x] Bug fix
- [ ] Improvement
- [ ] New extractor
- [ ] New feature
---
### Description of your *pull request* and other information
Since summer 2021, YouTube has started serving media URLs with a query parameter such as `...&n=SXiXBH-xzrjeioPN&...`. This now appears to be the default behaviour. Unless the value of this parameter is transformed according to an algorithm delivered in the site player JS, the download speed for the URL is throttled to ~50kB/s.
Solutions for this include:
* implementing a more complete JS interpreter, eg based on PR #11272;
* using an external JS interpreter (PhantomJS, now unmaintained, is used by some extractors);
* spoofing the Android or iOS client to acquire unthrottled links, as successfully implemented in [yt-dlp](https://github.com/yt-dlp/yt-dlp/commit/c888ffb95ab0ab4f4cd1d6c93eda014f80479551).
This PR takes a different approach derived from the successful solution used in VLC's `youtube.lua` (also implemented differently in [pytube](https://github.com/tfdahlin/pytube/blob/bb890af3b271a616bbe1d08abc8c65bac9266b0a/pytube/cipher.py)). The approach relies on the fact that the challenge algorithm is served in a mini-language within the minified player JS and therefore the specific algorithm can be extracted and executed by interpreting the mini-language without actually running the JS itself. [In parallel with this PR, a separate implementation of this approach, but also using a more complete JS interpreter, was added to [yt-dlp](https://github.com/yt-dlp/yt-dlp/commit/404f611f1c4aa516fbc4301aa7b8f734ee4bc67b).]
The implementation of the mini-language interpreter is directly translated from VLC's `n_descramble()` [Lua function](https://code.videolan.org/videolan/vlc/-/blob/4fb284e5af69aa9ac2100ccbdd3b88debec9987f/share/lua/playlist/youtube.lua#L116). The result sufficiently resembles the original that it should be straightforward to share changes between the two implementations.
The PR also includes fixes for `test/test_youtube_lists.py`. This download test failed in Python 2 and contained tests that failed or were redundant because of obsolete assumptions about the `youtube.py` extractor or YouTube services.
Anyone who wants a single file update to fix the 2021.06.06 release pending merge/release of the PR should use [this version of `extractor/youtube.py`](https://raw.githubusercontent.com/ytdl-org/youtube-dl/20fc43475289bd3335e5f96a8e0d8f5432f1d806/youtube_dl/extractor/youtube.py) which is a drop-in replacement.
Resolves #29326
Resolves #29790
Resolves #30004
Resolves #30024
Resolves #30052
Resolves #30088
Resolves #30097
Resolves #30102
Resolves #30109
Resolves #30119
Resolves #30125
Resolves #30128
Resolves #30162
Resolves #30173
Resolves #30186.
Jak tylko zostanie wciągnięty do master’a to zupgadeujemy.
Kiedy wejdzie? - na razie nie wiadomo.
Dla niecierpliwych: wystarczy podmienić dwa pliki i działa
Owczar
3 Listopad 2021 19:04
#10
No to teraz wszystko jasne
Dzięki za wytłumaczenie. Póki co działa - video nie używam. Ale zauważyłem właśnie problem na kodi, nie da się oglądać z YouTube