2014-03-04, 23:12
Yes that is a good guide to follow for creating a new resolver, you can reference existing ones for help:
https://github.com/Eldorados/script.modu...er/plugins
To use just import urlresolver:
Then you can use it in a few ways
One you can compile a list of possible hosts that you site uses and pass in to urlresolver to filter and prompt the user with a list:
Or filter a list of sources and send back the list to you to do as you like:
Or just resolve a straight url:
You can look at my RedLetterMedia addon for some easy reference:
https://github.com/Eldorados/eldorado-xb...ettermedia
https://github.com/Eldorados/script.modu...er/plugins
To use just import urlresolver:
Code:
import urlresolver
Then you can use it in a few ways
One you can compile a list of possible hosts that you site uses and pass in to urlresolver to filter and prompt the user with a list:
Code:
sources = []
media = urlresolver.HostedMediaFile(host=host, media_id=linkid, title='Some Host')
sources.append(media)
source = urlresolver.choose_source(sources)
if source:
stream_url = source.resolve()
else:
stream_url = False
#Play the stream
if stream_url:
addon.resolve_url(stream_url)
Or filter a list of sources and send back the list to you to do as you like:
Code:
filtered_list = urlresolver.filter_source_list(host_list)
Or just resolve a straight url:
Code:
stream_url = urlresolver.resolve(url)
You can look at my RedLetterMedia addon for some easy reference:
https://github.com/Eldorados/eldorado-xb...ettermedia