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
228 stars 21 forks source link

Playlists? #3

Closed Yankees4life closed 1 year ago

Yankees4life commented 1 year ago

Hello there

This tool looks pretty good but I see that it only uses channels. Any plans to include playlists too?

I have a watch later playlist that I would love to place in my JF library

Cheers

fe80Grau commented 1 year ago

Hello dude, check the last commit in main branch. I added a few lines to accept playlist, just add your public playlists id with "list-" prefix in your channel_list.json

[
    "/user/xbox",
    "list-PLbZIPy20-1pN7mqjckepWF78ndb6ci_qi"
]

Tell me if working or not

Yankees4life commented 1 year ago

Hello dude, check the last commit in main branch. I added a few lines to accept playlist, just add your public playlists id with "list-" prefix in your channel_list.json

[
    "/user/xbox",
    "list-PLbZIPy20-1pN7mqjckepWF78ndb6ci_qi"
]

Tell me if working or not

Getting weird "[Errno 22] invalid argument" errors when running it

fe80Grau commented 1 year ago

check now with last commit, if not woks you can share your config.json and channel_list.json

Yankees4life commented 1 year ago

check now with last commit, if not woks you can share your config.json and channel_list.json

python cli.py --m make_files_strm --p youtube,download
07/04/2023 12:59:18
Running make_files_strm with ['youtube', 'download'] params
Traceback (most recent call last):
  File "C:\Users\Jean\Documents\Projects\ytdlp2STRM\cli.py", line 259, in <module>
    r = getattr(sys.modules[__name__], method)(*params)
  File "C:\Users\Jean\Documents\Projects\ytdlp2STRM\cli.py", line 174, in make_files_strm
    for youtube_channel in channels():
  File "C:\Users\Jean\Documents\Projects\ytdlp2STRM\cli.py", line 46, in channels
    channels = json.load(f)
  File "C:\Program Files\Python39\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Program Files\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python39\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 3 column 2 (char 16)

got this weird error

configs

[ "@deportes" "list-PLUO17ahPW9iPzKfNrAzlOCO8peao7EUwS" ]

{ "strm_output_folder" : "F:\youtube\", "ytdlp2strm_host" : "127.0.0.1", "ytdlp2strm_port" : "5777", "ytdlp2strm_channels_list_file" : "channel_list.json", "ytdlp2strm_days_dateafter" : "60", "ytdlp2strm_videos_limit" : "50" }

fe80Grau commented 1 year ago

check now with last commit, if not woks you can share your config.json and channel_list.json

python cli.py --m make_files_strm --p youtube,download
07/04/2023 12:59:18
Running make_files_strm with ['youtube', 'download'] params
Traceback (most recent call last):
  File "C:\Users\Jean\Documents\Projects\ytdlp2STRM\cli.py", line 259, in <module>
    r = getattr(sys.modules[__name__], method)(*params)
  File "C:\Users\Jean\Documents\Projects\ytdlp2STRM\cli.py", line 174, in make_files_strm
    for youtube_channel in channels():
  File "C:\Users\Jean\Documents\Projects\ytdlp2STRM\cli.py", line 46, in channels
    channels = json.load(f)
  File "C:\Program Files\Python39\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Program Files\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python39\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 3 column 2 (char 16)

got this weird error

configs

[ "@deportes" "list-PLUO17ahPW9iPzKfNrAzlOCO8peao7EUwS" ]

{ "strm_output_folder" : "F:\youtube\", "ytdlp2strm_host" : "127.0.0.1", "ytdlp2strm_port" : "5777", "ytdlp2strm_channels_list_file" : "channel_list.json", "ytdlp2strm_days_dateafter" : "60", "ytdlp2strm_videos_limit" : "50" }

A comma is missing in yor channel list (between "@deportes" and "list...")

[ "@deportes", "list-PLUO17ahPW9iPzKfNrAzlOCO8peao7EUwS" ]

Yankees4life commented 1 year ago

Haha. Yep. I now realized that. But now I'm still getting Errno error

fe80Grau commented 1 year ago

Maybe double counterslash for windows folders? "strm_output_folder" : "F:\youtube",

Yankees4life commented 1 year ago

Maybe double counterslash for windows folders? "strm_output_folder" : "F:\youtube",

Did that...and same error

fe80Grau commented 1 year ago

Ok, back to home I was able to reproduce your case, I was not aware of the Windows file name restrictions. That was breaking the pipe and hiding the real error. Using the sanitize_filename library solves this. I've updated it in the requirements.txt file and edited the code to avoid pipe breaks by using getoutput in all yt-dlp commands.

Pull the last commit and make sure you have the sanitize_filename library installed in python pip install sanitize_filename

***For config.json "strm_output_folder" put this: F:/youtube (only one slash, it's working fine on my PC) Check and tell me

Yankees4life commented 1 year ago

OK, now that worked