Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
cc_southpark.py
#!/usr/bin/env python3
import json
from beautifulscraper import BeautifulScraper
from pprint import pprint as pp
URL = "http://southpark.cc.com/feeds/carousel/video/08f60a6f-24a8-4d88-88a3-eb5588494cbc/30/1/json/views/season-"
def seasonClips(URL):
VIDS = []
scraper = BeautifulScraper()
body = scraper.go(URL)
j = json.loads(body.text)
for d in j['results']:
u = d.get('_url').get('default').split('#')[0]
VIDS.append(u)
return VIDS
for season in range(1,22):
target = f'{URL}{season}'
# print(target)
[ print(u) for u in seasonClips(target) ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.