Skip to content

Instantly share code, notes, and snippets.


Last active Dec 7, 2015
What would you like to do?
Converts "Los 40 principales" playlist to "Artist - Title" to use with for example and import to Deezer/Spotify
import requests
import re
import unicodedata
REGEX_LOS40 = "datos_cancion_\d+\['(titulo_cancion|nombre_artista)'\]\s*=\s*'([^\']*)'"
def removeAccents(data):
return unicodedata.normalize('NFKD', data).encode('ASCII', 'ignore').decode()
def sanitize(artist):
return re.sub(r'(?is)\(.+', '', artist)
response = requests.get(url="")
regexFind = re.finditer(REGEX_LOS40, response.text)
i = 0
artist = ''
title = ''
for match in regexFind:
if i % 2 == 0:
title =
artist =
print(artist + "-" + title)
title = ''
artist = ''
i += 1

This comment has been minimized.

Copy link

mathieue commented Dec 7, 2015

Hello. I am the creator of playlist converter.
First: thanks for the contribution.
Is it possible it take your code for a tutorial on ? take the code or reference this gist to be more precise..
Second: do you have any feature request for my tool as you are an advanced user.. coding... Any idea of an input better than free text ? what do you think about csv ?

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.