1 # -*- coding: utf-8 -*-
3 from urllib
.parse
import parse_qsl
4 from lib
.scraper
import Scraper
9 action
, key
, artist
, album
, url
, nfo
, settings
= self
._parse
_argv
()
10 Scraper(action
, key
, artist
, album
, url
, nfo
, settings
)
12 def _parse_argv(self
):
13 params
= dict(parse_qsl(sys
.argv
[2].lstrip('?')))
14 # actions: find, resolveid, NfoUrl, getdetails
15 action
= params
['action']
17 key
= params
.get('key', '')
19 artist
= params
.get('artist', '')
21 album
= params
.get('title', '')
22 # url: provided by the scraper on previous run
23 url
= params
.get('url', '')
24 # nfo: musicbrainz url from .nfo file
25 nfo
= params
.get('nfo', '')
26 # path specific settings
27 settings
= params
.get('pathSettings', {})
28 return action
, key
, artist
, album
, url
, nfo
, settings
31 if (__name__
== '__main__'):