Open Angu0083 opened 3 years ago
Try removing the -u
from the second command you tried IE:
D:\GIT\viki-downloader-main>python link_downloader.py https://www.viki.com/tv/20503c-my-love-from-the-star
P.S. You will need viki pass for it to work with this show, so when the chrome browser opens, sign in with your viki details before pressing ENTER on the script to continue. (Make sure you end up back on the main page though before pressing ENTER) I would also recommend using youtube-dl with the list of downloaded links as a batch file input, because its much better than vid_sub_downloader.py atm. This gives you files which allow you to watch them on mpv or something, but if you want mp4 you will need another script which I can upload if you want.
Try removing the
-u
from the second command you tried IE:
D:\GIT\viki-downloader-main>python link_downloader.py https://www.viki.com/tv/20503c-my-love-from-the-star
P.S. You will need Viki to pass for it to work with this show, so when the chrome browser opens, sign in with your Viki details before pressing ENTER on the script to continue. (Make sure you end up back on the main page though before pressing ENTER) I would also recommend using youtube-dl with the list of downloaded links as a batch file input because it's much better than vid_sub_downloader.py atm. This gives you files that allow you to watch them on MPV or something, but if you want mp4 you will need another script which I can upload if you want.
Thanks for your response, Yes, I need those scripts to save the VIKI videos in MP4 format.
I have added two batch scripts you can use (on windows).
youtube-dl-from-downloaded-links.bat
can be ran after you run the link_downloader.py
script. This will download all the video files as mpd format (basically a list of streams).
Inside youtube-dl-subs-from-downloaded-links.bat
change the language to whichever language you want. Here is some examples of how it works: https://superuser.com/questions/927523/how-to-download-only-subtitles-of-videos-using-youtube-dl
once those are done you can place them in a folder or something for example "streams" folder, but remember where it is. Then run python parse_mpd.py -h
to see what options there are for the script and then run it. You will need ffmpeg installed (either in your PATH variable, or in the same folder as the scripts). You will need to specify the folder where the mpd files are and the video and audio qualities you want, and whether you want to accept lower quality than you specify.
For example:
python parse_mpd.py -i "streams" -a "720p" -v "720p" -t
This will then download the audio and video, stitch them together into one mp4 and put them all in an "output" folder.
Let me know if there are any more problems.
I have added two batch scripts you can use (on windows).
youtube-dl-from-downloaded-links.bat
can be ran after you run thelink_downloader.py
script. This will download all the video files as mpd format (basically a list of streams). Insideyoutube-dl-subs-from-downloaded-links.bat
change the language to whichever language you want. Here is some examples of how it works: https://superuser.com/questions/927523/how-to-download-only-subtitles-of-videos-using-youtube-dlonce those are done you can place them in a folder or something for example "streams" folder, but remember where it is. Then run
python parse_mpd.py -h
to see what options there are for the script and then run it. You will need ffmpeg installed (either in your PATH variable, or in the same folder as the scripts). You will need to specify the folder where the mpd files are and the video and audio qualities you want, and whether you want to accept lower quality than you specify. For example:python parse_mpd.py -i "streams" -a "720p" -v "720p" -t
This will then download the audio and video, stitch them together into one mp4 and put them all in an "output" folder.Let me know if there are any more problems.
Hello,
I successfully extracted the links from the following command "D:\GIT\viki-downloader-main>python link_downloader.py https://www.viki.com/tv/20503c-my-love-from-the-star".
I was a change language from zh to en and run the bat file. After that, I got an error.
Error 01:
C:\Windows\system32>youtube-dl --write-sub --sub-lang en --ignore-errors -o "%(title)s.%(ext)s" --batch-file=downloaded_links.txt ERROR: batch file downloaded_links.txt could not be read
Make sure you are in the same directory when you run the above command. From an earlier post I think you should be in D:\Git\viki-downloader-main
. It should work then.
Instead of running the command yourself, you can edit the batch file, (right click -> edit) and change the language there. Then save and double-click the batch file in the folder to run it.
Instead of running the command yourself, you can edit the batch file, (right click -> edit) and change the language there. Then save and double-click the batch file in the folder to run it.
Hello, Thanks for support and previously I executed the script directly with administrator privilege. Right now, I was successfully downloaded video from Viki. During the download, I was expected to download video in Full HD or HD but the script was downloading the video in 360P.
After the ffmpeg output, subtitles wasn't merged with video and I've attached the zip file of the output. Reference.zip
360p is probably the highest quality stream that was available for the video. Unfortunately that is not a problem that can be fixed with my code, it is probably a youtube-dl thing.
The subtitles can be downloaded to separate files using the youtube-dl-subs-from-downloaded-links.bat
file.
These subtitle files can then be used in video player like mpv or vlc.
360p is probably the highest quality stream that was available for the video. Unfortunately, that is not a problem that can be fixed with my code, it is probably a youtube-dl thing.
The subtitles can be downloaded to separate files using the
youtube-dl-subs-from-downloaded-links.bat
file. These subtitle files can then be used in a video player like MPV or vlc.
I have streamed the videos at HD quality using the Viki pass on the web. Could you fix the code as soon to download the videos at HD / 720P Quality?
I think this is likely an issue with youtube-dl so you might be best taking it up with them. If you want you can link one of the mpd files that are downloaded. I can visually check if there are 720p video streams available in there.
Note: You may need to supply your viki login details in the youtube-dl command to get the HD videos
I think this is likely an issue with youtube-dl so you might be best taking it up with them. If you want you can link one of the MPD files that are downloaded. I can visually check if there are 720p video streams available in there.
Note: You may need to supply your Viki login details in the youtube-dl command to get the HD videos
I was successfully generated the MPD files using youtube-dl with Viki username and Password.
But there was a problem with downloading video and audio files using parse_mpd.py script. Those scripts will not accept Viki credentials. Kindly fix the parse_mpd.py script to accept the credentials to download the HD and FHD videos.
Could you send over one of the mpd files? Or if you want you can search yourself, if you have grep then you can use
grep "BaseURL" "mpd_file.mpd" | grep "track1"
then look to see if there are 720p, 1080p etc.
On windows you can use cmd equivalent command findstr "BaseURL" "mpd_file.mpd" | findstr "track1"
If the 720p 1080p etc. stream links aren't there, then unfortunately my script can't do anything about it. It would have to be resolved in youtube-dl
Could you send over one of the mpd files? Or if you want you can search yourself, if you have grep then you can use
grep "BaseURL" "mpd_file.mpd" | grep "track1"
then look to see if there are 720p, 1080p etc. On windows you can use cmd equivalent commandfindstr "BaseURL" "mpd_file.mpd" | findstr "track1"
If the 720p 1080p etc. stream links aren't there, then unfortunately my script can't do anything about it. It would have to be resolved in youtube-dl
Hi, I successfully extracted links for the 720P Video file. The below link will only work if you already logged on a browser with a Viki pass.
Anyway, I was happy with your scripts to download videos with 360P at Viki, and All the Best for your further Projects.
Ok, actually if that link is in the file then I think the script should work. However, when I look in your reference.zip
linked earlier, I can't find the link you just shared.
Perhaps could you try running youtube-dl script again and then run parse_mpd.py again and let me know.
P.S. I think it should work, because the audio and video parsing works the same way (its the same function) and it correctly found the 720p link for the audio, but couldn't find it for the video.
Edit: Also running parse_mpd.py without the This is bugged actually :D-t
it won't download the lower quality version.
I just updated the parse_mpd.py script so you might want to make sure you are running on the latest version 👍
I just updated the parse_mpd.py script so you might want to make sure you are running on the latest version 👍
Currently, YouTube-dl released the new version (2021.01.08) a few days before, and accidentally I was upgraded the youtube-dl on my VM.
After that, I was run youtube-dl-subs-from-downloaded-links.bat and I will automatically be downloading 480P video and audio tracks and merge them into a single file with a subtitle, Other than an MPD file.
There was a bug in youtube-dl (latest Version) fail to accept the Viki credentials and extract the HD and FHD media URL (The Bug in Viki extractor API Tokens ).
Finally, I wrote a very basic bash script to download videos using old MPD files.
I was very impressed with python scripts and I was trying to learn python.
Thanks for your time and keep doing it....
Hello, While executing the script, I've got an error and popup chrome. The error details are below,
The Error01
D:\GIT\viki-downloader-main>python link_downloader.py
DevTools listening on ws://127.0.0.1:60424/devtools/browser/05e7d0aa-324a-467b-a23a-76a3b0d6222f [3068:6704:0109/181633.665:ERROR:device_event_log_impl.cc(211)] [18:16:33.665] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F) [3068:6704:0109/181633.666:ERROR:device_event_log_impl.cc(211)] [18:16:33.666] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F) Traceback (most recent call last): File "link_downloader.py", line 92, in
driver = init_driver()
File "link_downloader.py", line 41, in init_driver
driver.get(sys.argv[1]) # 1st argument should be the url to the viki show.
IndexError: list index out of range
The Error02
D:\GIT\viki-downloader-main>python link_downloader.py -u https://www.viki.com/tv/20503c-my-love-from-the-star
DevTools listening on ws://127.0.0.1:60063/devtools/browser/35ff0ae8-97cc-4208-b240-3bb3a4ce80bd Traceback (most recent call last): File "link_downloader.py", line 92, in
driver = init_driver()
File "link_downloader.py", line 41, in init_driver
driver.get(sys.argv[1]) # 1st argument should be the url to the viki show.
File "C:\Users\AnguRaj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})
File "C:\Users\AnguRaj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\AnguRaj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
(Session info: chrome=87.0.4280.88)