I'm going on a trip. The internet will probably be pretty horrible, at least at first.
I've been asking everyone their Desert Island Recommendations. One of mine is The Dollop. This is how you download every episode of The Dollop with a little bit of python.
You have to install python3, requests, and beautifulsoup4. I won't help you with that, but there are a load of good resources.
import time
import requests
from bs4 import BeautifulSoup
def download(href, title, extension="mp3"):
filename = "%s.%s" % (title, extension)
filename = filename.replace("/", "-")
# todo, path management
local_filename = filename
r = requests.get(href, stream=True)
with open(local_filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
return local_filename
# The archive page lets you pick page number (1) and more importantly, episode count (500)
# This lets me ignore pagination.
all_eps_page_request = requests.get("http://thedollop.libsyn.com/webpage/page/1/size/500")
soup = BeautifulSoup(all_eps_page_request.content, 'html.parser')
table = soup.find('div', attrs={"class": "content"}).find('table')
for row in table.find_all('tr')[57:]:
title_link = row.find('a', attrs={"class": 'postTitle'})
try:
title = title_link.text
except:
continue
direct_link = row.find('div', attrs={"class": 'postDetails'}).find('a')
try:
href = direct_link.attrs['href']
except:
continue
print(title, href)
download(href, title)
print("*")
# Be a little kind to their server
time.sleep(1)
23rd January 2018
I won't ever give out your email address. I don't publish comments but if you'd like to write to me then you could use this form.
I'm Issac. I live in Oakland. I make things for fun and money. I use electronics and computers and software. I manage teams and projects top to bottom. I've worked as a consultant, software engineer, hardware designer, artist, technology director and team lead. I do occasional fabrication in wood and plastic and metal. I run a boutique interactive agency with my brother Kasey and a roving cast of experts at Kelly Creative Tech. I was the Director of Technology for Nonchalance during the The Latitude Society project. I was the Lead Web Developer and then Technical Marketing Engineer at Nebula, which made an OpenStack Appliance. I've been building things on the web and in person since leaving Ohio State University's Electrical and Computer engineering program in 2007. Lots of other really dorky things happened to me before that, like dropping out of high school to go to university, getting an Eagle Scout award, and getting 6th in a state-wide algebra competition. I have an affinity for hopscotch.