import requests
from bs4 import BeautifulSoup
host = 'https://megapesni.club'
link = 'https://megapesni.club/rap_2018/140731-miyagi-captain.html'
headers = {'user-agent':'Hottabxp - Cool Hacker!'}
response = requests.get(link, headers=headers)
soup = BeautifulSoup(response.text,'html.parser')
song_title = soup.find('h1',class_='music-title').text
url = soup.find('a',class_='song-author-btn song-author-btn--download').get('href')
response = requests.get(host+url,headers=headers)
with open(song_title+'.mp3','wb') as mp3:
mp3.write(response.content)
Python - самый простой в мире инструмент для парсинга и скачивания файлов. И это факт!
Beautiful Soup на русском языке
Requests: HTTP for Humans™