YouKu is the equivalent of YouTube in China, and earlier today I wanted to download a video from the service, so I’ve looked for an application or script that can do the job in Linux. I’ve finally come across you-get, a python 3 script that claims to be able to download videos from an impressive number of websites, namely:
NetEase (网易视频) (v.163.com)
|QQ (腾讯视频) (v.qq.com)
Sina (新浪视频) (video.sina.com.cn)
Sohu (搜狐视频) (tv.sohu.com)
Baidu (百度音乐) (music.baidu.com)
I won’t try all, but just test it with YouKu and YouTube. First things first, let’s install it:
git clone git://github.com/soimort/you-get.git cd you-get sudo apt-get install python3 python3-setuptools ./you-get -V make install
Time to go to youku.com and download a video:
you-get http://v.youku.com/v_show/id_XNTQ1OTk3NTAw.html Video Site: Youku.com Title: 1 second boot QT app in linux-sunxi with A10 Type: Flash video (video/x-flv) Size: 5.45 MB (5711001 Bytes) Downloading 1 second boot QT app in linux-sunxi with A10.flv ... 100.0% ( 5.4/5.4 MB) [========================================] 1/1
Success! And now Youtube:
you-get https://www.youtube.com/watch?v=A-9NKWm748o Video Site: YouTube.com Title: Sigma Designs Digital Signage Demo - Frame Layout Type: Flash video (video/x-flv) Size: 1.14 MB (1196352 Bytes) Downloading Sigma Designs Digital Signage Demo - Frame Layout.flv ... 100.0% ( 1.1/1.1 MB) [========================================] 1/1
All good, and that was easy. To download several videos, you can either write you own script, or add videos in you-get command line such as “you-get link2video1 link2video2 … link2videon“.
I remember somebody on G+ wanted to upload several videos to YouKu, so while I was on this subject, I decided to have a look at YouKu upload scripts as well.
There is indeed a script called “pyYouku“, which is also written in Python, that allows you to upload videos to YouKu. Once you download the software, you just need to update config.py with your username, password, and partner ID (API key). The latter is quite problematic, as you have to apply to become a developer (easy), and then request an API key by sending YouKu an email with your business name & address, business phone and business license (hard). And this is where I gave up…