Skip to content

Instantly share code, notes, and snippets.

@neoplacer
Created November 8, 2019 21:22
Show Gist options
  • Save neoplacer/2e58a6c0481b470553f4644aae9340e6 to your computer and use it in GitHub Desktop.
Save neoplacer/2e58a6c0481b470553f4644aae9340e6 to your computer and use it in GitHub Desktop.
import pycurl
import os.path
import sys
import wget
from bs4 import BeautifulSoup
if __name__ == '__main__':
#Get the rss feed with the list of items
if len(sys.argv) < 2:
print "Error: you didn't give the xml file with the RSS info. Exiting."
exit()
rss_xml = open(sys.argv[1])
parser = BeautifulSoup(rss_xml.read(), "lxml")
rss_xml.close()
episodes = parser.findAll("item")
for podcast in episodes:
print podcast.enclosure['url']
url = str(podcast.enclosure['url'])
wget.download(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment