/g/ - Technology

Install Gentoo

Mode: Reply
Remaining characters: 4095
Max filesize: 6.00 MB
anon 07/21/2021 (Wed) 07:42:59 12258
How the fuck do I get video duration of videos in a youtube playlist using its api. https://developers.google.com/youtube/v3/docs/playlistItems says it has been depreciated, what do they use now?
anon 07/21/2021 (Wed) 09:24:58 12259 Reply
>>12258 post what you have tried so far and in which language are you trying to implement it in, very easy to do it with a one line bash script
anon 07/21/2021 (Wed) 09:56:07 12263 Reply
>>12258 It does not seem related to what I think you are wanting to do. It seems that property is the time when playlist owners wants the video to start. Instead store the video id and use it to get its duration.
anon 07/21/2021 (Wed) 10:10:17 12265 Reply
>>12259 Python I did it, but its not the best solution I am trying to create a .csv file with titles of all videos uploaded on doordarshan youtube and their respective durations. The problem is that it has 16k videos in total. I already have extracted all titles. To get the duration I take out the video_id from playlist items and use the code given here https://stackoverflow.com/questions/33698776/how-can-i-get-the-duration-of-youtube-video-with-python And run for every video in the playlist But this is quite slow and I wonder if there is a faster method.
anon 07/21/2021 (Wed) 10:12:36 12266 Reply
>>12265 Another thing is youtube api has a daily quota of points. You can olny make certain amount of requests per day and I am pretty sure, it wont work for 16k videos. Or I have to do it in batches.
anon 07/21/2021 (Wed) 11:45:13 12268 Reply
>>12259 >very easy to do it with a one line bash script Using youtubedl? Yeah that is what I am going to do next.
anon 07/21/2021 (Wed) 13:11:03 12269 Reply
>>12266 16k videos is too much man, your best bet would be using youtube-dl and preforming this task on some VPS for maximum efficiency
anon 07/21/2021 (Wed) 13:11:56 12270 Reply
>>12269 Performing*
anon 07/21/2021 (Wed) 13:31:28 12271 Reply
>>12269 I doubt it, scraping video titles happened surprisingly quickly. Scrapinh video durations shouldnt take much time, if programmed efficiently. I'll use some other approach tomorrow.
anon 07/21/2021 (Wed) 13:46:15 12272 Reply
>>12271 Use Google collab or something, it will be even faster.
anon 07/22/2021 (Thu) 13:12:58 12305 Reply
>>12264 Update: Using this, it is very fast now on test run for a smaller channel with 17 videos, i got nearly 2.7 seconds for the whole execution.
anon 07/22/2021 (Thu) 14:12:17 12306 Reply
>>12305 BTW what are you planning to do with it?
anon 07/23/2021 (Fri) 21:35:53 12343 Reply
>>12306 Wouldnt you like to know :DDD
Board Home Catalog Logs