4141 os .path .splitext (os .path .basename (job ))[0 ] for job in twitcast_jobs
4242]
4343
44+
4445def announce_shit (msg = "Unknown" ):
4546 if not DISCORD_WEBHOOK_URL :
4647 vtlog .debug ("No Discord Webhook url, skipping announcement..." )
@@ -64,6 +65,7 @@ def reset_handler(r=True):
6465 console .setFormatter (formatter0 )
6566 vtlog .addHandler (console )
6667
68+
6769reset_handler (False )
6870
6971upload_mapping = {
@@ -131,15 +133,9 @@ def reset_handler(r=True):
131133
132134 vtlog .info ("Executing streamlink command!" )
133135
134- save_ts_name = (
135- "'" + BASE_VTHELL_PATH + "streamdump/" + filename + ".ts'"
136- )
137- save_mux_name = (
138- BASE_VTHELL_PATH + "streamdump/" + filename + ".mkv"
139- )
140- save_ts_name1 = (
141- BASE_VTHELL_PATH + "streamdump/" + filename + ".ts"
142- )
136+ save_ts_name = "'" + BASE_VTHELL_PATH + "streamdump/" + filename + ".ts'"
137+ save_mux_name = BASE_VTHELL_PATH + "streamdump/" + filename + ".mkv"
138+ save_ts_name1 = BASE_VTHELL_PATH + "streamdump/" + filename + ".ts"
143139
144140 STREAMLINK_CMD .extend ([save_ts_name , stream_url , "best" ])
145141 MKVMERGE_CMD .append (save_mux_name )
@@ -198,15 +194,16 @@ def reset_handler(r=True):
198194 continue
199195 else :
200196 announce_shit (
201- "Twitcast ID: "
202- + user
203- + " recorded, will be muxed and uploaded."
197+ "Twitcast ID: " + user + " recorded, will be muxed and uploaded."
204198 )
205199 vtlog .info ("Executing mkvmerge command!" )
206200 vtlog .debug (" " .join (MKVMERGE_CMD ))
207201 sp .call (MKVMERGE_CMD )
208202
209- if os .path .isfile (save_mux_name ) and os .path .getsize (save_mux_name ) > 0 :
203+ if (
204+ os .path .isfile (save_mux_name )
205+ and os .path .getsize (save_mux_name ) > 0
206+ ):
210207 UPLOAD_CMD .extend (
211208 [
212209 save_mux_name ,
0 commit comments