fe80Grau / ytdlp2STRM

A little script to serve Youtube / Twitch / Crunchyroll videos without storage it. Uses yt-dlp HTTP data throught Flask and dynamic URLs. We can use this dynamic URLs to set STRM files.
https://github.com/fe80Grau/ytdlp2STRM
MIT License
209 stars 19 forks source link

[Feature Request] get /@live/streams #15

Closed weslleylab closed 10 months ago

weslleylab commented 11 months ago

Please help me with some information? I installed it and added the Youtube url but I believe that the Youtube folder should be generated within Media but this did not happen

fe80Grau commented 11 months ago

I need more info. Open a terminal, go to folder where you have ytdlp2STRM and run the next command: python .\cli.py --media youtube --params direct paste here the output.

fe80Grau commented 11 months ago

I fix it, pull last commit and test.

Anyway, I have seen that I have not optimized this and I do not recommend using the "keyword-" prefix at the moment, it is too slow. I will work to improve it, while I insist on recommending against using it. Sorry...

weslleylab commented 11 months ago

Okay, thanks for this project.

11/10/2023 10:23:01 Running youtube with ['direct'] params Preparing channel keyword-24/7 ao vivo Created directory: /media/Youtube/@TheGoodLiferadio [UChs0pSaEoNLV4mevBFGaoKA] Traceback (most recent call last): File "/opt/ytdlp2STRM/cli.py", line 48, in main() File "/opt/ytdlp2STRM/cli.py", line 45, in main r = eval("{}.{}.{}".format("plugins",method,"to_strm"))(*params) File "/opt/ytdlp2STRM/plugins/youtube/youtube.py", line 594, in to_strm keyword_strm( File "/opt/ytdlp2STRM/plugins/youtube/youtube.py", line 558, in keyword_strm f.folders.write_file( TypeError: folders.write_file() missing 1 required positional argument: 'content' root@vps-821b678b:/opt/ytdlp2STRM#

fe80Grau commented 11 months ago

I added some prints to debug your error, but i think that it will work with the last commit, pull and try again You will get an output like this, (paste it here if you get more errors)

12/10/2023 12:29:18
Running youtube with ['direct'] params
Preparing channel keyword-24/7 ao vivo
Searching keyword-24/7 ao vivo...
Working channel URL: https://www.youtube.com/channel/UChs0pSaEoNLV4mevBFGaoKA?novideo
Getting channel ID...
Generating name folder...
Getting name...
Getting description...
Getting thumbnails...
novideo flag, only channel info...
File created: D:/Youtube/@TheGoodLiferadio [UChs0pSaEoNLV4mevBFGaoKA]/The Good Life Radio • 247 Live Radio  Best Relax House, Chillout, Study, Running, Gym, Happy Music 2023-10-12 1229.strm
Working channel URL: https://www.youtube.com/channel/UCUsm-fannqOY02PNN67C0KA?novideo
Getting channel ID...
Generating name folder...
Getting name...
Getting description...
Getting thumbnails...
novideo flag, only channel info...
File created: D:/Youtube/@nmas [UCUsm-fannqOY02PNN67C0KA]/Noticias en vivo 247 FOROtv 2023-10-12 1229.strm
Working channel URL: https://www.youtube.com/channel/UCD04yL7cANb5RW4LgsQjqOg?novideo
Getting channel ID...
Generating name folder...
Getting name...
Getting description...
Getting thumbnails...
novideo flag, only channel info...
.
.
.
weslleylab commented 11 months ago

I really appreciate your efforts. I would just like to know if it is possible to correct one more thing. When I use "https://www.youtube.com/@live/streams" it displays the following error:

14/10/2023 16:01:55 Running youtube with ['direct'] params Preparing channel https://www.youtube.com/@live/streams Working channel URL: https://www.youtube.com/@live/streams/videos Getting channel ID... Traceback (most recent call last): File "/opt/ytdlp2STRM/cli.py", line 48, in main() File "/opt/ytdlp2STRM/cli.py", line 45, in main r = eval("{}.{}.{}".format("plugins",method,"to_strm"))(*params) File "/opt/ytdlp2STRM/plugins/youtube/youtube.py", line 614, in to_strm channel_strm( File "/opt/ytdlp2STRM/plugins/youtube/youtube.py", line 392, in channel_strm yt = Youtube( File "/opt/ytdlp2STRM/plugins/youtube/youtube.py", line 24, in init self.channel_id = self.get_id() File "/opt/ytdlp2STRM/plugins/youtube/youtube.py", line 74, in get_id if not self.channel_id: AttributeError: 'Youtube' object has no attribute 'channel_id'. Did you mean: 'channel'?

fe80Grau commented 11 months ago

Unfortunately, yt-dlpt does not support /@live/streams. It looks like a playlist but it is a special category on the official YouTube platform. I opened a feature request on yt-dlp. https://github.com/yt-dlp/yt-dlp/issues/8353

I'll try it with Streamlink and if it works I'll work on integrating Streamlink with this script ;)

fe80Grau commented 10 months ago

I close this. Follow here: https://github.com/orgs/yt-dlp/projects/3?pane=issue&itemId=43918250