Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use python to climb the audio of the whole Himalayan station

Shulou Source: shulou.com Published: 2022-06-02 06:54:48 10月04日 Update

Himalayan FM is a well-known audio sharing platform, with a market share of 73% in the mobile audio industry and more than 480 million users. Tonight, we will take you to break through layers of obstacles and explore the sounds of nature in the Himalayas, so as to capture them in real time and save them locally.

Development environment: Windows, pycharm, requests, json

Knowledge points:

1. Network anti-crawling technology

2. File operation

3. Data conversion

4. The use of dictionary, string and list data types

Again, we require the use of Firefox or Google; we need to determine a few things next:

1. Identify the web site (Himalayan web site)

2. Network request to obtain data (click on the audio we want)

3. Data filtering (screening the audio we want)

4. Save the data (save the audio we need)

Some of the procedures are as follows:

Url = "https://www.ximalaya.com/revision/play/album?albumId=291718&psgeNum=1&sort=1&page"

Response = requests.get (url,headers=header) .text

Audio_data = json.loads (response) ["data"] ["tracksAudioPlay"]

For audio_in in audio_data:

Music_url = audio_info ["src"]

"https://fdfs.xmcdn.com/group61/M05/70/C1/wKgMcFoJCZuw9cSkAB9RrgvYaVU283.m4a"

Music_name = music_url.split ("/") [- 1]

.

The full video follows the official account (self-taught Uncle Xian) or scan the QR code below and reply "Himalayas" in the official account to get resources.

This article is shared from the official account of Wechat-self-taught Uncle Xian (gh_3de5e20d92e5).

If there is any infringement, please contact support@oschina.cn for deletion.

This article participates in the "OSC Source Program". You are welcome to join us and share it.

Tags: Audio data Himalayan public browser URL web browsing breakthrough well-known next share Teana dictionary character string real-time market market share platform Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Technology NVidia Xiaomi Shulou Information