Closed ruiguo-bio closed 6 years ago
Getting the proper video filename might be tricky, since it's not in the json containing video information, but I will give it a try.
On the other side, I also wanted to have a progress bar so it has been added :) Parallelized download has been disabled for now, working on how to sync the progress bar between downloads in the console.
Thank you. I think coursera-dl may have all the behavior I suggested. If possible, you can take a look on their code :)
I will take a look at this, I might switch to the tqdm library since its so well done. Thanks for reporting !
Another interesting issue is when I download one machine learning for musicians course, it split the 8 introduction section videos into 8 folders, like the picture below:
Those videos are all in the first section, so they should be in the 1-introduction folder
Progress bar issue should be fixed. It seems to be the buffering behaving differently on OSX, I use print(s, flush=True) now instead of sys.stdout.flush() so that should take care of it.
The naming issue is due to this course not following naming convention used on other courses videos (first number in the filename should be session number) but found a workaround, and I downloaded the introduction at only one place :)
Still need more time for implementing proper video names as I don't want anyone to redownload all video so will need to figure also a way to rename them.
any progress on naming files? maybe you could make in optional through configuration? really inconvenient to browse through cryptic files names when downloaded.
Honestly, I haven't looked hard into it, apologies :) The optional parameter is a great idea, as the default download would still be usable if getting names failed.
I will get some testing done this week and let you know.
Seems like Kadenze included the video title in the json data since last time I checked, and I've got good results getting them.
I will be doing more checks on differents courses by downloading them multiple times and will be pushing the changes later this week if all ok.
Videos will now be named by their respective videos titles (activated by default in configuration) when possible. It should always be the case tho, haven't encountered any issue so far on several courses.
Also a new dependency needs to be installed, by running "pip install -r requirements.txt" on a refreshed clone repository.
Let me know if any issue :)
works great. thanks for prompt response.
Thank for you good job! I find the video name is directly got from the download file name e.g. 3.1_2_720.mp4, and it's better replaced by the meaningful name in the media queue.
Also I hope when downloading, it will show the percentage bar of each downloading file. If one file is not downloaded successfully, it should not be saved so the next time it can be downloaded again, not just skipped. Many of my downloaded file is not completed, due to my poor network :(