Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help getting yt-dlp to spawn on events? #64

Open
N1ck01 opened this issue Apr 18, 2023 · 4 comments
Open

Help getting yt-dlp to spawn on events? #64

N1ck01 opened this issue Apr 18, 2023 · 4 comments

Comments

@N1ck01
Copy link

N1ck01 commented Apr 18, 2023

Help getting yt-dlp to spawn on events (Windows OS)?

I've never looked into using the advanced options of the config file before because the simple command line arguments have always successfully downloaded streams, but recently I'm encountering more and more failed downloads that is now forcing me to look into the advanced options of the config file to try to see if spawning yt-dlp for all downloading events could be more reliable.
I'm not having any success at spawning yt-dlp on any events though and because I'm so unfamiliar with these advanced options I don't know if it's a problem on my end or not, being a user error on my part or not; or the problems I'm encountering trying to do this has to do with the recent known errors just posted about, but I would have thought spawning yt-dlp would bypass those errors...
I would like to spawn yt-dlp for both monitor.py and download.py, and for any and all instances of downloading, pending streams and active streams.
If anyone can currently successfully spawn yt-dlp to download on Windows OS, could you please explain in detail how you're executing it?
Thank you, regards!

Snippet of the most recent failed download error I've encountered without using a config file and the following command:
python livestream_saver.py monitor --max-video-quality 720 --output-dir "C:\Users\USEREDITED\Desktop\livestream_saver-main\Downloads" --channel-name "NAMEEDITED" --delete-source --scan-delay 10.0 URLEDITED

2023-04-17 18:41:32,684 - WARNING - download.VIDEOIDEDITED - An output directory a
lready existed. We assume a failed download attempt. Last segment available was
2089.
2023-04-17 18:41:32,685 - INFO - download.VIDEOIDEDITED - Will start downloading f
rom segment number 2088.
2023-04-17 18:41:32,955 - INFO - download.VIDEOIDEDITED - Stream seems to be viewe
d live. Good.
2023-04-17 18:41:32,955 - INFO - download.VIDEOIDEDITED - Stream status flags: Sta
tus.OK
2023-04-17 18:41:33,891 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="137"      mime_type="video/mp4"   res="1080p"     fps="30fps"     vcodec="
avc1.4d4028"    progressive="False"     type="video">
2023-04-17 18:41:33,892 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="248"      mime_type="video/webm"  res="1080p"     fps="30fps"     vcodec="
vp9"    progressive="False"     type="video">
2023-04-17 18:41:33,893 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="136"      mime_type="video/mp4"   res="720p"      fps="30fps"     vcodec="
avc1.4d401f"    progressive="False"     type="video">
2023-04-17 18:41:33,893 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="247"      mime_type="video/webm"  res="720p"      fps="30fps"     vcodec="
vp9"    progressive="False"     type="video">
2023-04-17 18:41:33,894 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="135"      mime_type="video/mp4"   res="480p"      fps="30fps"     vcodec="
avc1.4d401f"    progressive="False"     type="video">
2023-04-17 18:41:33,895 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="244"      mime_type="video/webm"  res="480p"      fps="30fps"     vcodec="
vp9"    progressive="False"     type="video">
2023-04-17 18:41:33,895 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="134"      mime_type="video/mp4"   res="360p"      fps="30fps"     vcodec="
avc1.4d401e"    progressive="False"     type="video">
2023-04-17 18:41:33,896 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="243"      mime_type="video/webm"  res="360p"      fps="30fps"     vcodec="
vp9"    progressive="False"     type="video">
2023-04-17 18:41:33,896 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="133"      mime_type="video/mp4"   res="240p"      fps="30fps"     vcodec="
avc1.4d4015"    progressive="False"     type="video">
2023-04-17 18:41:33,896 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="242"      mime_type="video/webm"  res="240p"      fps="30fps"     vcodec="
vp9"    progressive="False"     type="video">
2023-04-17 18:41:33,896 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="160"      mime_type="video/mp4"   res="144p"      fps="30fps"     vcodec="
avc1.4d400c"    progressive="False"     type="video">
2023-04-17 18:41:33,897 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="278"      mime_type="video/webm"  res="144p"      fps="30fps"     vcodec="
vp9"    progressive="False"     type="video">
2023-04-17 18:41:33,897 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="139"      mime_type="audio/mp4"   abr="48kbps"    acodec="mp4a.40.5"
progressive="False"     type="audio">
2023-04-17 18:41:33,898 - INFO - download.VIDEOIDEDITED - Available <Stream:
itag="140"      mime_type="audio/mp4"   abr="128kbps"   acodec="mp4a.40.2"
progressive="False"     type="audio">
2023-04-17 18:41:33,898 - INFO - download.VIDEOIDEDITED - Selected video <Stream:
itag="136" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.4d401f" pro
gressive="False" type="video">
2023-04-17 18:41:33,899 - INFO - download.VIDEOIDEDITED - selected audio <Stream:
itag="140" mime_type="audio/mp4" abr="128kbps" acodec="mp4a.40.2" progressive="F
alse" type="audio">
Downloading segment 2358...2023-04-17 18:44:03,732 - CRITICAL - download.VIDEOIDE
DITED - <class 'urllib.error.URLError'>: <urlopen error [WinError 10061] No conne
ction could be made because the target machine actively refused it>
2023-04-17 18:44:03,733 - WARNING - download.VIDEOIDEDITED - Waiting for 3 seconds
 before retrying... (attempt 1/10)
Downloading segment 2610...2023-04-17 18:46:34,277 - INFO - download.VIDEOIDEDITED
 - Forcing update of download URLs.
Downloading segment 3100...2023-04-17 18:51:39,119 - INFO - download.VIDEOIDEDITED
 - Forcing update of download URLs.
Downloading segment 3610...2023-04-17 18:56:40,921 - INFO - download.VIDEOIDEDITED
 - Forcing update of download URLs.
2023-04-17 18:56:41,095 - CRITICAL - download.VIDEOIDEDITED - Missing streamingDat
a key in json!
2023-04-17 18:56:41,096 - ERROR - download.VIDEOIDEDITED - 'streamingData'
Traceback (most recent call last):
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\dow
nload.py", line 652, in streams
    query = pytube.StreamQuery(self.fmt_streams)
                               ^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\dow
nload.py", line 1365, in fmt_streams
    pytube.extract.apply_descrambler(self.player_config_args, fmt)
  File "C:\Users\USEREDITED\AppData\Local\Programs\Python\Python311\Lib\site-packages
\pytube\extract.py", line 519, in apply_descrambler
    streaming_data = stream_data["player_response"]["streamingData"]
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'streamingData'
2023-04-17 18:56:41,098 - WARNING - download.VIDEOIDEDITED - Failed to get streams
 from fmt_streams (pytube error).
2023-04-17 18:56:41,098 - INFO - download.VIDEOIDEDITED - Getting stream descripto
rs from MPD...
2023-04-17 18:56:41,099 - CRITICAL - download.VIDEOIDEDITED - No streamingData in
json. Cannot load MPD.
2023-04-17 18:56:41,099 - ERROR - download.VIDEOIDEDITED - Unhandled exception. Ab
orting.
Traceback (most recent call last):
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\dow
nload.py", line 1152, in download
    self.do_download()
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\dow
nload.py", line 1249, in do_download
    self.update_download_urls(force=True)
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\dow
nload.py", line 1028, in update_download_urls
    video_quality, audio_quality = self.get_best_streams(
                                   ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\dow
nload.py", line 1423, in get_best_streams
    avail_streams = self.streams
                    ^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\dow
nload.py", line 669, in streams
    raise Exception("Failed to load stream descriptors!")
Exception: Failed to load stream descriptors!
2023-04-17 18:56:41,101 - CRITICAL - download.VIDEOIDEDITED - Some kind of error o
ccured during download? Failed to load stream descriptors!
2023-04-17 18:56:41,102 - CRITICAL - livestream_saver - Error during stream down
load! Resuming monitoring...
2023-04-17 18:56:41,102 - INFO - livestream_saver.util - Sleeping for 11.81 minu
tes (708.79 seconds)...

Status of installed requirements:

C:\Users\USEREDITED\Desktop\livestream_saver-main>python -m pip install -r req
uirements.txt
Requirement already satisfied: pytube==10.9.2 in c:\users\USEREDITED\appdata\local\pr
ograms\python\python311\lib\site-packages (from -r requirements.txt (line 1)) (1
0.9.2)
Requirement already satisfied: Pillow in c:\users\USEREDITED\appdata\local\programs\p
ython\python311\lib\site-packages (from -r requirements.txt (line 2)) (9.3.0)
Requirement already satisfied: yt-dlp in c:\users\USEREDITED\appdata\local\programs\p
ython\python311\lib\site-packages (from -r requirements.txt (line 4)) (2023.3.4)

Requirement already satisfied: mutagen in c:\users\USEREDITED\appdata\local\programs\
python\python311\lib\site-packages (from yt-dlp->-r requirements.txt (line 4)) (
1.46.0)
Requirement already satisfied: pycryptodomex in c:\users\USEREDITED\appdata\local\pro
grams\python\python311\lib\site-packages (from yt-dlp->-r requirements.txt (line
 4)) (3.17)
Requirement already satisfied: websockets in c:\users\USEREDITED\appdata\local\progra
ms\python\python311\lib\site-packages (from yt-dlp->-r requirements.txt (line 4)
) (11.0.1)
Requirement already satisfied: certifi in c:\users\USEREDITED\appdata\local\programs\
python\python311\lib\site-packages (from yt-dlp->-r requirements.txt (line 4)) (
2022.12.7)
Requirement already satisfied: brotli in c:\users\USEREDITED\appdata\local\programs\p
ython\python311\lib\site-packages (from yt-dlp->-r requirements.txt (line 4)) (1
.0.9)

C:\Users\USEREDITED\Desktop\livestream_saver-main>

Custom edited livestream_saver.cfg file:

[DEFAULT]
log_level = INFO

[common]
ytdlp_command = yt-dlp
	--format "bv*[height<=720]+ba/b[height<=720]/best"
	--output "%(uploader)s - (%(upload_date)s) %(title)s [%(id)s].%(ext)s"
	--embed-metadata
	--embed-thumbnail
	--fragment-retries 50
	--live-from-start
	--wait-for-video 180
	%VIDEO_URL%

[monitor]
scan_delay = 15
skip_download = true

# This triggers when an upcoming video is listed in the channel page.
on_upcoming_detected_command = ${common:ytdlp_command}
on_upcoming_detected_command_logged = true

# This should trigger only for non-live videos (VOD).
on_video_detected_command = ${common:ytdlp_command}
on_video_detected_command_logged = true

# This triggers when a download is pending and waiting for a livestream to start.
on_download_initiated_command = ${common:ytdlp_command}
on_download_initiated_command_logged = true

# This triggers when the download has actually started on an active livestream.
on_download_started_command = ${common:ytdlp_command}
on_download_started_command_logged = true

[download]
scan_delay = 3
skip_download = true

# This triggers when a download is pending and waiting for a livestream to start.
on_download_initiated_command = ${common:ytdlp_command}
on_download_initiated_command_logged = true

# This triggers when the download has actually started on an active livestream.
on_download_started_command = ${common:ytdlp_command}
on_download_started_command_logged = true

Results of custom config w/ monitor command for active stream:

C:\Users\USEREDITED\Desktop\livestream_saver-main>python livestream_saver.py m
onitor --config-file "C:\Users\USEREDITED\Desktop\livestream_saver-main\livest
ream_saver\livestream_saver.cfg" https://www.youtube.com/@PBSNewsHour
2023-04-17 21:53:56,574 - INFO - livestream_saver.cookies - No cookie path submi
tted. Using a blank cookie jar.
2023-04-17 21:53:56,837 - INFO - livestream_saver - Monitoring channel: @PBSNews
Hour
2023-04-17 21:53:58,694 - INFO - livestream_saver.monitor - Currently listed Fea
tured videos: 1
afHkx2Ercm0 - PBS NewsHour West live episode, April 17, 2023 (LiveStream) LIVE N
OW!
2023-04-17 21:53:58,992 - INFO - livestream_saver.monitor - Currently listed com
munity videos: 5
wFdkQqX8CyU - A Brief But Spectacular take on working together for climate actio
n
c3idNUXitVk - Literary critics give their takes on the best of books of 2022
Si2A9pptXDA - U.S. armed forces members band together to celebrate Hanukkah thro
ugh song
Yro8EyoTABI - WATCH: Rep. Cheney says Trump `unfit for any office' | Jan. 6 fina
l meeting
hh5-EdaXtvI - WATCH: Why white residents in Providence may qualify for reparatio
ns | Washington Week Recommends
2023-04-17 21:53:59,351 - INFO - livestream_saver.monitor - Currently listed pub
lic videos: 30
h-why2S7itg - PBS NewsHour full episode, April 17, 2023
arujchJyeyM - A Brief But Spectacular take on the future of CRISPR
Y5IwR49IZQY - Jenny Odell's new book 'Saving Time' gives fresh perspective on th
e meaning of time
N6_A1xJWuWs - Crosley Green returns to prison, maintains innocence after murder
conviction reinstated
d-6OyfBG2dI - Russian opposition leader sentenced to prison for denouncing Putin
's war in Ukraine
HeVLAKOP8Jo - House Republicans hold NYC hearing targeting DA bringing criminal
charges against Trump
VSmyc89ta6s - Civilians caught in crossfire as rival factions battle for control
 of Sudan
22jT9i8c744 - News Wrap: McCarthy says Republicans will vote to raise debt ceili
ng with cap on spending
vn3QFKQWjnk - Four dead, 15 more wounded in shooting at birthday party in small
Alabama town
WKnQ4QhEgnM - WATCH: House Speaker McCarthy promises to raise debt ceiling only
with spending cuts
L9TowtuOWcI - PBS News Weekend full episode, April 16, 2023
DaTMKZnX9FE - `Tetris' screenwriter on translating dramatic history of Soviet ga
me to film
1hpNKhcaUcQ - Schools, families feel the pinch after end of federal free meal pr
ogram
s2N3U2s3COM - Why mortality for young Americans is increasing at an alarming rat
e
oPUq9fHS1Gk - News Wrap: World leaders urge end to violent clash between forces
in Sudan
1w60qjaJem4 - PBS News Weekend full episode, April 15, 2023
LnD0VivAIqk - Native tribe in Louisiana highlights challenges of climate-driven
relocation
L7fZMIaw_xI - U.S. sees concerning rise in STIs, congenital syphilis with no sig
ns of slowing
69l79E1nTM0 - Journalists retrace fateful journey of a group of African migrants
 lost at sea
dFj_GlXzSv0 - News Wrap: Deadly conflict, airstrikes erupt in Sudan's capital ci
ty
1YG9G-JPhDo - PBS NewsHour full episode, April 14, 2023
uYm0BtXuuQ8 - Guardsman accused of leaking classified information charged under
Espionage Act
0Kmvbzy2L0M - Explorer halfway through journey to walk around the world
ZofRAlvkkZk - NPR's Mary Louise Kelly describes how she balances her career and
family in new book
8e_tgoofhnQ - Brooks and Capehart on the 2024 campaign as Republican candidates
headline big GOP events
GDXLyNhoNdo - Why the U.S. designated the animal tranquilizer xylazine an 'emerg
ing threat'
fJr3P6LZudc - Sen. Feinstein faces more calls to resign over absence from Capito
l Hill
4QvzA2Ca6OU - News Wrap: 28 Sinaloa cartel members charged in U.S. fentanyl traf
ficking case
WhsX_OA6KAo - `I'm just getting started': Musician Jon Batiste on the next phase
 of his musical journey
IQ7pMqV9pHk - PBS NewsHour full episode, April 13, 2023
2023-04-17 21:53:59,744 - INFO - livestream_saver.monitor - Currently listed pub
lic Live streams: 30
inLI9vWzpB4 - WATCH LIVE: Kevin McCarthy delivers speech after 100 days as House
 speaker
afHkx2Ercm0 - PBS NewsHour West live episode, April 17, 2023 (LiveStream) LIVE N
OW!
-HepfX6-Rhs - WATCH LIVE: Pentagon gives news briefing as the U.S., South Korean
 and Japan conduct military drills
vUFCHi9p9fI - WATCH LIVE: Biden speaks outside St. Muredach's Cathedral in Count
y Mayo, Ireland
utLeeY-RFNQ - WATCH: Garland announces charges against El Chapo sons and Sinaloa
 cartel for fentanyl trafficking
7L0aSLuNH18 - PBS NewsHour West live episode, April 13, 2023
in9IpnEcBdo - WATCH LIVE: Harris announces federal investments in bridge infrast
ructure repairs
-bjK9klpoyI - WATCH LIVE: Pentagon holds news briefing as U.S. continues to resp
ond to classified documents leak
iJQRT0bxG1M - WATCH LIVE: Biden addresses Irish parliament while on visit to cou
ntry
zLXXwFdGFKg - PBS NewsHour West live episode, April 12, 2023
zWD4Rim-c_w - WATCH LIVE: EPA Administrator Micheal Regan announces new rules to
 spur sales of electric vehicles
V2kp9mWIdRs - PBS NewsHour West live episode, April 11, 2023
TX9X8vbgvuM - WATCH LIVE: Blinken and Austin hold briefing after meeting with Fi
lipino counterparts
i55nhju3VpI - WATCH LIVE: Yellen holds news conference during IMF-World Bank spr
ing meetings
1iyTcF9D_PU - PBS NewsHour West live episode, April 10, 2023
QGp3V0A4l7M - WATCH LIVE: White House holds briefing after dueling court rulings
 set up new fight over abortion
s0ICQDdip5k - WATCH LIVE: State Department holds news briefing as China complete
s military drills near Taiwan
FIrOLrEVqNU - WATCH LIVE: Biden and First Lady Jill Biden host the 2023 White Ho
use Easter Egg Roll
0Ndpv0VKxTw - PBS NewsHour West live episode, April 7, 2023
-fKjh3jip2k - PBS NewsHour West live episode, April 6, 2023
H6o4gSbGZdg - WATCH LIVE: White House holds briefing as China threatens 'forcefu
l' measures after Taiwan meeting
wz0QLejvzxY - WATCH LIVE: State Department holds briefing as rivals Saudi Arabia
 and Iran restore diplomatic ties
hvyUq4aXk2c - PBS NewsHour West live episode, April 5, 2023
g9pr3K1mM94 - WATCH LIVE: House Speaker McCarthy holds news briefing after meeti
ng with Taiwan president
XiBy_e3EB4Y - WATCH LIVE: White House holds news briefing ahead of Biden's Irela
nd visit
FjyygwARAOw - WATCH LIVE: Pentagon holds news briefing as NATO welcomes Finland
to military alliance
W_4SNzA0P3s - WATCH LIVE: Blinken holds news conference at NATO headquarters as
Finland joins military alliance
MAuqEKfjeMo - WATCH LIVE: Trump speaks at Mar-a-Lago after pleading `not guilty'
 to 34 felony counts in New York
udFRUmbAd6U - PBS NewsHour West live episode, April 4, 2023
utfeZ-MzM44 - WATCH LIVE: Manhattan DA Alvin Bragg holds news conference followi
ng Trump arraignment
2023-04-17 21:53:59,747 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
Missing streamingData key in json!
Error acessing title from player_response: 'videoDetails'
2023-04-17 21:54:02,256 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
Missing streamingData key in json!
Error acessing title from player_response: 'videoDetails'
2023-04-17 21:54:04,540 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
Missing streamingData key in json!
Error acessing title from player_response: 'videoDetails'
2023-04-17 21:54:06,390 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:08,819 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:11,004 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:13,324 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:15,588 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:17,671 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:20,144 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:22,480 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:24,984 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:27,511 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:29,916 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:31,927 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:34,389 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:36,798 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:38,693 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:41,471 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:43,879 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
2023-04-17 21:54:45,741 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
Missing streamingData key in json!
Error acessing title from player_response: 'videoDetails'
2023-04-17 21:54:48,027 - INFO - livestream_saver - Found live: afHkx2Ercm0. Tit
le: "PBS NewsHour West live episode, April 17, 2023".
Traceback (most recent call last):
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver.py"
, line 1030, in <module>
    exit(main())
         ^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver.py"
, line 1002, in main
    error = args["func"](config, args)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver.py"
, line 497, in monitor_mode
    live_videos = ch.filter_videos('isLiveNow')
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\mon
itor.py", line 606, in filter_videos
    for home_vid in self.get_home_videos(update=update):
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\mon
itor.py", line 185, in get_home_videos
    self.get_json_and_cache("Home", update=True)),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\mon
itor.py", line 169, in get_json_and_cache
    self._cached_json = self.get_tab_json_from_api(tab_name)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\mon
itor.py", line 685, in get_tab_json_from_api
    return self.session.make_api_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\req
uest.py", line 336, in make_api_request
    return str_as_json(self.get_response_as_str(req))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\Desktop\livestream_saver-main\livestream_saver\req
uest.py", line 416, in get_response_as_str
    return str(res.read().decode('utf-8'))
               ^^^^^^^^^^
  File "C:\Users\USEREDITED\AppData\Local\Programs\Python\Python311\Lib\http\client.p
y", line 459, in read
    return self._read_chunked(amt)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\AppData\Local\Programs\Python\Python311\Lib\http\client.p
y", line 591, in _read_chunked
    value.append(self._safe_read(chunk_left))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\AppData\Local\Programs\Python\Python311\Lib\http\client.p
y", line 630, in _safe_read
    data = self.fp.read(amt)
           ^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\AppData\Local\Programs\Python\Python311\Lib\socket.py", l
ine 706, in readinto
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line
 1278, in recv_into
    return self.read(nbytes, buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USEREDITED\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line
 1134, in read
    return self._sslobj.read(len, buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
^C
C:\Users\USEREDITED\Desktop\livestream_saver-main>

Results of custom config w/ download command for active stream:

C:\Users\USEREDITED\Desktop\livestream_saver-main>python livestream_saver.py d
ownload --config-file "C:\Users\USEREDITED\Desktop\livestream_saver-main\lives
tream_saver\livestream_saver.cfg" https://www.youtube.com/watch?v=afHkx2Ercm0
2023-04-17 21:55:17,484 - INFO - livestream_saver.cookies - No cookie path submi
tted. Using a blank cookie jar.
Livestream afHkx2Ercm0 playability status is: ERROR Reason: This video is unavai
lable. Sub-reason: Watch on the latest version of YouTube.. Error reason: The fo
llowing content is not available on this app..
Outdated client error. Retrying shortly...
2023-04-17 21:55:17,842 - INFO - livestream_saver.util - Sleeping for 2.58 minut
es (154.83 seconds)...
@glubsy
Copy link
Owner

glubsy commented Apr 18, 2023

Indeed, Youtube is breaking everything lately, I'm looking into fixing these errors.

Your config file looks good, so I'm wondering if yt-dlp is found in your $PATH. Perhaps try invoking it directly from the same environment just to make sure it can be invoked that way. You could also replace "yt-dlp" with the absolute path to the executable (at ytdlp_command =) and see if that fixes it.

@N1ck01
Copy link
Author

N1ck01 commented Apr 21, 2023

Thank you for the reply and recommendation, but I'm unfortunately still encountering the same errors while trying to call the config file while directly calling the absolute path to the yt-dlp executable in any/every way I try (from a global common command, from full command line arguments for every monitor/download command listing, with and without quotes around the executable path), but if I force stop (Ctrl+C) the livestream_saver command window while errors are cycling and just paste in the yt-dlp command arguments only into the same command window, yt-dlp will start downloading fragments. So I can get livestream_saver and yt-dlp to work separately but can not get livestream_saver to spawn yt-dlp in any way.
Would love to know if any others can successfully?

@glubsy
Copy link
Owner

glubsy commented Apr 21, 2023

It works for me on Linux, so I wonder if this only happens on Windows for whatever reason. Unfortunately I don't have a Windows machine to test on right now.

I suggest running with debug log level and making sure the "Triggered event hook" line appears wherever yt-dlp should be called.

@N1ck01
Copy link
Author

N1ck01 commented Apr 23, 2023

Hmm, tested with the debug log level and none of the words "trigger/event/hook" ever appears...
Unless another Windows user here can say different, for whatever reason it appears livestream_saver can't/doesn't trigger yt-dlp in any way.
I've reached my level of debugging on this but thank you again for trying to provide some guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants