提取优酷订阅视频的RSS源

I’ve been tinkering with RSS these past few days and have collected quite a few RSS sources. For lazy people like us, knowing the news without opening a webpage is what RSS is truly about. Recently, I managed to get the RSS output for QQ Space (not very practical…) as well as for Sina Weibo and Sina Blog. However, I still prefer Logic Thinking (on Youku), which does not provide an RSS subscription. So far, I haven’t discovered any particularly effective methods to extract Youku subscription RSS feeds. Various online conversion sites are mostly useless, and I can’t tolerate the hassle of having to open a webpage to do this. So, I decided to dive into how to turn Youku subscriptions into an RSS feed, and I succeeded! It was very satisfying.


Initially, I had no clues. When opening a video page for Logic Thinking, I found this strange link:
http://v.youku.com/v_show/id_XNzc5NjE2MzM2.html

Clearly, XNzc5NjE2MzM is encoded using some method. One reason Youku encodes URLs and does not open RSS subscriptions is to make money from ads. However, this private encoding seems tricky, so I decided to check the page source:

It looked complicated, so I thought I might as well download it locally.

I discovered this page on GOOGLE:
http://u.youku.com/user_show/id_79241663.html
After opening, it corresponds to:
http://i.youku.com/u/UMzE2OTY2NjUy
【Note】The previous ID was numeric!!

As expected, it is specially encoded, and with this parsed encoding, it became manageable. After downloading this page offline and checking its source code, I found this line:

Do you see a similarity with the previous link?

The content of the string variable ownerId is “79241663”!

It’s the same as the number following the decrypted link ID! Now that we have this variable name, let’s open the source code for Logic Thinking using the same method and find this chunk of code:

Look at the variables:

1
2
3
4
5
var videoId = '194904084';
var videoId2= 'XNzc5NjE2MzM2';
var video_owner = '128391495';
var showid="286842";
var showid_en="5bdbf57c947311e3b8b7";

The variable names differ from the ones above, but it’s still clear that the subscription user ID is: 128391495.
Now, one question remains: what is the RSS output format for Youku videos?

At first, I felt perplexed for a long time… It turned out that if you’re willing to go through some trouble, you’ll always find a solution.
I found some RSS addresses like this on Google:
http://www.youku.com/playlist/rss/id/xxxxxx (where xxxxxx represents a numeric ID).
Similarly, if you randomly open an album on the Youku website, the URL format is:
http://www.youku.com/playlist_show/id_xxxxxx.html
It is clear that when Youku converts URLs into RSS addresses, it removes _show after playlist, and the format becomes /rss/id/xxxxxx.
In the same manner, the video URL for Logic Thinking:
http://v.youku.com/v_show/id_128391495.html
outputs as RSS like this:
http://www.youku.com/user/rss/id/128391495
Done! Now I can subscribe to various videos through RSS, which is very satisfying.

The article is finished. If you have any questions, please comment and communicate.

Scan the QR code on WeChat and follow me.

Title:提取优酷订阅视频的RSS源
Author:LIPENGZHA
Publish Date:2015/08/19 14:56
World Count:2.4k Words
Link:https://en.imzlp.com/posts/23354/
License: CC BY-NC-SA 4.0
Reprinting of the full article is prohibited.
Your donation will encourage me to keep creating!