Skip to content

Instantly share code, notes, and snippets.

@Busata
Created December 3, 2016 10:30
Show Gist options
  • Save Busata/982f7e3cda85089925b7a6b6db753a8f to your computer and use it in GitHub Desktop.
Save Busata/982f7e3cda85089925b7a6b6db753a8f to your computer and use it in GitHub Desktop.
class PlaylistParser:
_strategy = {"audio/x-scpls": PlaylistParserPLS(),
"application/pls+xml": PlaylistParserPLS(),
"audio/mpegurl": PlaylistParserM3U(),
"audio/x-mpegurl": PlaylistParserM3U(),
"application/xspf+xml": PlaylistParserXSPF()
}
def parse(self, mime, data):
self.data = data
return self._stragegy[mime].parse()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment