Kethsar / ytarchive

Garbage Youtube livestream downloader
MIT License
1.2k stars 96 forks source link

[Feature Request] add filename tweak option like --trim-filenames #226

Open UVJkiNTQ opened 3 weeks ago

UVJkiNTQ commented 3 weeks ago

Since youtube allows a long title for streams, it is possible to meet a long tile which exceed the filesystem limitaiton. I met the 'file name too long' error and fail to mux the ts files.

Kethsar commented 3 weeks ago

I actually have something in place to do this automatically already. Did you see this message in your download? If so, can you post what it truncated to and what filesystem you use?

2024-10-28_09-34-48

UVJkiNTQ commented 3 weeks ago

File system: ext4

Sorry I have cleared the terminial log and manually muxed the files with deletion. The log ouput I saw do not have this warning.

I remember I have seen an error on deletion of frag ts file, and warning of 'file name too long' of that ts file.

The playback of stream is here for your reference: https://www.youtube.com/watch?v=VLjabsU3jIg

Kethsar commented 3 weeks ago

What version of ytarchive are you using?

UVJkiNTQ commented 3 weeks ago

0.5.0 install with go

Kethsar commented 3 weeks ago

Hm, odd. Next time you see it happen, paste the logs if you can.

UVJkiNTQ commented 3 weeks ago

okay. I will keep the log next time.

I will keep this issue open.

UVJkiNTQ commented 3 weeks ago

➜ yta ytarchive --monitor-channel -c cookies.txt -4 --add-metadata -t --vp9 --write-descr iption -td ./temp --write-thumbnail -l -o '犬山たまき/%(uploaddate)s%(title)s' https://w ww.youtube.com/channel/UC8NZiqKx6fsDT3AVcMiVFyA/live best --no-check-certificate ytarchive 0.5.0

2024/10/29 01:42:40 Waiting for stream, retrying every 60 seconds... 2024/10/29 22:01:06 Channel: Tamaki Ch. 犬山たまき / 佃煮のりおted: 72000 seconds 2024/10/29 22:01:06 Video Title: 【#イケボホストクラブ】一年振りのキャスト全員集合🍷✨【犬山たまき/ 夢追翔/神田笑一/ベルモンド・バンデラス/オリバー・エバンス/夕刻ロベル】 2024/10/29 22:01:06 Selected quality: 1080p60 (h264) 2024/10/29 22:01:06 Stream started at time 2024-10-29T14:00:10+00:00 Video Fragments: 1000; Audio Fragments: 1000; Total Downloaded: 569.38MiB 2024/10/29 22:22:51 ERROR: Error retrieving player response: unable to retrieve player response object from watch page 2024/10/29 22:22:51 WARNING: Error deleting file: stat temp/JH67j_LAHvM1096355344/20241029_【#イケボホストクラブ】一年振りのキャスト全員集合🍷✨【犬山たまき⧸夢追翔⧸神田笑一⧸ベルモンド・バンデラス⧸オリバー・エバンス⧸夕刻ロベル】.f140.frag1000.ts: file name too long 2024/10/29 22:22:51 WARNING: Error deleting file: stat temp/JH67j_LAHvM1096355344/20241029【#イケボホストクラブ】一年振りのキャスト全員集合🍷✨【犬山たまき⧸夢追翔⧸神田笑一⧸ベルモンド・バンデラス⧸オリバー・エバンス⧸夕刻ロベル】.f299.frag1000.ts: file name too long Video Fragments: 1000; Audio Fragments: 1000; Total Downloaded: 569.38MiB 2024/10/29 22:22:51 Download Finished 2024/10/29 22:22:51 Muxing final file... size= 571335KiB time=00:00:00.04 bitrate=117009358.6kbits/s speed=0.00272x 2024/10/29 22:23:12 Final file: /home/luke/yta/犬山たまき/20241029【#イケボホストクラブ】一年振りのキャスト全員集合🍷✨【犬山たまき⧸夢追翔⧸神田笑一⧸ベルモンド・バンデラス⧸オリバー・エバンス⧸夕刻ロベル】.mp4 2024/10/29 22:23:13 You have opted to wait for a livestream to be scheduled. Retrying every 60 seconds. Retries: 1 (Last retry: 2024/10/29 22:24:13), Total time waited: 60 seconds


This time it seems sucessfully output a file but error occurs.

Kethsar commented 3 weeks ago

Ahhh I see, my check on file name length had the limit set to %output_name%.description, but fragment files end up with %format%.frag%frag_num%.ts at the end, which is a fair bit more. I haven't used fragment files for so long I forgot to account for that. I know what to do to fix this at least.