Skip to content

Instantly share code, notes, and snippets.

@akkefa
Created March 9, 2018 10:34
Show Gist options
  • Save akkefa/9f9b4cf6933bdc6a1866fdd3526259a5 to your computer and use it in GitHub Desktop.
Save akkefa/9f9b4cf6933bdc6a1866fdd3526259a5 to your computer and use it in GitHub Desktop.
"""Downloading mp3"""
from bs4 import BeautifulSoup
import re
import requests
import urllib
from os import system
r = requests.get("http://")
soup = BeautifulSoup(r.text, "html5lib")
for a in soup.findAll('a', href=re.compile('http.*\.mp3')):
print(a['href'].replace(" ", "%20"))
link = a['href'].replace(" ", "%20")
system('wget -c "{}"'.format(link))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment