Tips: When you see this prompt, it means that the current article has been migrated from the original emlog blog system. The publication date of the article is quite old, and the formatting and content may not be complete. Please understand.
Web Packet Capture: My Playlist
Date: 2018-6-5 A Jue Tutorial Views: 2521 Comments: 4
Recently, I've seen many blogs posting tutorials about web packet capturing, which has sparked my interest, leading to the creation of this article.Just recently, My Playlist had its API integration with Kugou fail, so I took the opportunity to fix it and create a graphic tutorial. Let's take a look at Kugou.
About the concept of packet capturing
Packet capture refers to the interception, retransmission, editing, and storage of data packets sent and received over a network, and is also used to check network security. Packet capturing is often used for data interception as well.
— From Gay Encyclopedia
Here, we are discussing the interception of data transmitted over the web, and do not involve retransmission, editing, or other operations that affect network security.
In fact, I published several articles about packet capturing back in 2016, but due to the age of the articles, images have been lost or broken, and the order is all mixed up.
Packet capturing may be relatively unfamiliar to those doing WEB development, especially back-end developers, but since I come from a desktop application background, I find it quite easy to use.
Purpose:
Analyze Kugou song direct link - Fix my playlistTarget website:
http://t.kugou.com/1md5hf5t8V2 Kugou my playlist share short URLTools used:
Google Chrome F12 (or Ctrl + Shift + I, or right-click > Inspect) Developer tools(Note: Please refer to the images in the following tutorial. If unclear, right-click to open the image in a new window.)
Here, I am capturing the mobile version of the page because the desktop version returns the entire playlist directly in the source code, making it inconvenient for us to analyze. The mobile version returns JSON.
Preserve Log: The function is to keep the previous logs after the page redirects.
The phone icon in the upper left corner: Switch the current browsing interface's UA to mobile UA.
Enter the URL and press enter to access; the webpage will redirect.
Status code 302, received the redirect address (be sure to check the image, the text description has been simplified).
The packet capture ends here, and we will start analyzing:
It can be confirmed that the music links on the Kugou website are definitely not fixed.
Based on past experience, these are suspicious parameters.
In the packet capture logs, I searched and found the method to obtain the entire playlist list, which includes the basic information of the songs.
Analyzing the list link, it is clear that the parameters here are very similar to the previous ones.
Next, we will analyze the link for each song.
The validity period of the direct link for songs is about 24 hours, after which it will expire.
Continue to check the packet capture logs.
By including the song's hash value, you can obtain the relevant information and direct link for the song (the hash value has already been returned in the previous song list).
Summary:
Short URL -> Web link parameters -> Obtain playlist list -> Obtain songs (step by step, use the parameters obtained from the previous step to access the next URL).The related code can be written by yourself....-.-
It's been a long time since I posted such a tutorial-like article.
Lastly, I want to say that Google Developer Tools are really very useful!
Just a little promotion, bye~~
Related Recommendations
(1) Use PHP to capture Bing's daily images and use them for oneself .Mengkun Blog.
(2) Introduction to Packet Capturing (Part 1)
Related Code
(1) Source code for Kugou playlist to obtain song information
User Comments:
Yang Xiaojie Blog 3 years ago (2018-06-22)
You can provide code but don’t, how can we newbies play?A Jue 3 years ago (2018-06-22)
@Yang Xiaojie Blog: If you can provide code, try not to provide it. [#aru_88]Come on 1 month ago (2021-03-01)
@Yang Xiaojie Blog: This is a tutorial, there is no code.
Yang Xiaojie Blog 3 years ago (2018-06-05)
Big shot [#aru_42]