bibanon / tubeup

Use yt-dlp to download video/metadata and upload to the Internet Archive.
https://pypi.python.org/pypi/tubeup/
GNU General Public License v3.0
424 stars 71 forks source link

Abstracted item-name format into a function; fix(ing) issue when 'display_id' is null. #304

Closed Windows81 closed 1 year ago

vxbinaca commented 1 year ago

@brandongalbraith mind skimming this?

@Windows81 So I have a dumb blue collar brain I'm a tradesman by profession, I have a hard time looking over commits where you add and remove code it makes my dumb tradesman mind get lost. Can you make a PR where you test your code before making the PR, and then committing to the PR in one go? I'm having trouble understanding whats going on here.

Windows81 commented 1 year ago

Hey. I'll get back to you on this. I still need to familiarlise myself with CI. I did a few things here:

  1. I made a new function in utils.py that generates the item name (e.g. youtube-Yc9lFIS07xU) since that was being done in two different places.
  2. I fixed an edge case I was facing with SoundCloud, where info_dict exists, but doesn't have a display_id property.
Windows81 commented 1 year ago

I'll test this on my Twitch livestreams (how convenient!) within the next 24 hours. All the basic checks have passed this time, but I don't want to make the same mistake as last time.

vxbinaca commented 1 year ago

Cool point me to the new Twitch item made using this commit branch, just make sure it works with youtube extractor and I'll merge and cut a new version

Windows81 commented 1 year ago

Hey. I'll have to postpone my Twitch uploads to ease the rate limit on Internet Archive's end. I've been uploading all my songs on SoundCloud lately.

vxbinaca commented 1 year ago

Just one video you could make it a 20 second clip.

Windows81 commented 1 year ago

Hey. I've tested it on Twitch and it seems to work. When I made the commits, I made sure that my get_itemname makes a sub-call sanitize_identifier. Around lines 330-340, I removed the mention of sanitize_identifier because that would've otherwise called that function twice.

I'll wait about an hour or so until the IA link (https://archive.org/details/twitch-vod-v1849347342) works.

Here's the output log in non-debug mode for a ten-minute clip:

$ tubeup https://www.twitch.tv/videos/1849347342
Las Vegas Hotel Showcase - WIP Since March 2020 • https://www.roblox.com/games/4794911592
Unable to download video subtitles for 'rechat': HTTP Error 410: Gone
There are no annotations to write.
[download] 100.0% of        N/A at    7.00MiB/s ETA 00:00
Downloaded D:\Users\username\.tubeup\downloads\v1849347342.mp4
v1849347342: Possible MPEG-TS in MP4 container or malformed AAC timestamps
 uploading v1849347342.info.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  7.33MiB/s]
 uploading v1849347342.jpg: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  4.05MiB/s]
 uploading v1849347342.mp4: 100%|███████████████████████████████████████████████████████████████████████████████████████████| 205/205 [03:13<00:00,  1.06MiB/s]

:: Upload Finished. Item information:
Title: Las Vegas Hotel Showcase - WIP Since March 2020 • https://www.roblox.com/games/4794911592
Item URL: https://archive.org/details/twitch-vod-v1849347342
Windows81 commented 1 year ago

Update: I don't see the file on the website for some reason, despite success assurance. Could there be another culprit to the problem?

The file has been encoded correctly on IA -- just took an hour and more.

All the unit tests in test_tubeup.py passed.

brandongalbraith commented 1 year ago

Late to the party, but this looks good to me. Thanks for shipping this! 🚀

vxbinaca commented 1 year ago

The file has been encoded correctly on IA -- just took an hour and more.

Yeah things with IA sometimes take a little while. Twitch streams seem to have a lower priority.

vxbinaca commented 1 year ago

yeah and thanks again for the fix, hopefully we can get to a point where theres no dragons anymore