Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report