#!/usr/bin/env python3 # # Quirk to generate sublimefm playlist text file for importing in # Spotify (using Soundiiz for example). # # Rick van der Zwet # # License: https://rickvanderzwet.nl/LICENSE (BSD-2-Clause) # from bs4 import BeautifulSoup import argparse import glob import json import re import requests import time parser = argparse.ArgumentParser() parser.add_argument('date', type=str, default=time.strftime('%Y-%m-%d'), nargs='?') args = parser.parse_args() r = requests.get('https://sublimefm.nl/muziek?date=' + args.date) soup = BeautifulSoup(r.text, 'html.parser') #soup = BeautifulSoup(open('sublimefm.html','r'), 'html.parser') for artist in soup.find_all('span', class_='artist'): title = artist.parent.find(class_='title') print("%s - %s" %(artist.text, title.text)) #href = link.get('href') #if 'open.spotify.com/search/results/' in href: # print(href.split('/')[-1]) # from bs4 import BeautifulSoup import argparse import glob import json import re import requests import time parser = argparse.ArgumentParser() parser.add_argument('date', type=str, default=time.strftime('%Y-%m-%d'), nargs='?') args = parser.parse_args() r = requests.get('https://sublimefm.nl/muziek?date=' + args.date) soup = BeautifulSoup(r.text, 'html.parser') #soup = BeautifulSoup(open('sublimefm.html','r'), 'html.parser') for artist in soup.find_all('span', class_='artist'): title = artist.parent.find(class_='title') print("%s - %s" %(artist.text, title.text)) #href = link.get('href') #if 'open.spotify.com/search/results/' in href: # print(href.split('/')[-1])