This module is used for the creation of “Route callbacks”.

class codequick.resolver.Resolver[source]

This class is used to create “Resolver” callbacks. Resolver callbacks are callbacks that return playable video URL’s which Kodi can play.

Resolver inherits all methods and attributes from script.Script.

The possible return types from Resolver Callbacks are.
  • str: URL as type “str”.
  • iterable: “List” or “tuple”, consisting of URL’s, “listItem’s” or a “tuple” consisting of (title, URL).
  • dict: “Dictionary” consisting of “title” as the key and the URL as the value.
  • listItem: A codequick.Listitem object with required data already set e.g. “label” and “path”.
  • generator: A Python “generator” that return’s one or more URL’s.
  • False: This will cause the “resolver call” to quit silently, without raising a RuntimeError.


If multiple URL’s are given, a playlist will be automaticly created.

>>> from codequick import Resolver, Route, Listitem
>>> @Route.register
>>> def root(_):
>>>     yield Listitem.from_dict("Play video", play_video,
>>>           params={"url": ""})
>>> @Resolver.register
>>> def play_video(plugin, url):
>>>     # Extract a playable video url using youtubeDL
>>>     return plugin.extract_source(url)
extract_source(url, quality=None, **params)[source]

Extract video URL using “YouTube.DL”.

YouTube.DL provides access to hundreds of sites.

See also

The list of supported sites can be found at:

Quality options are.
  • 0 = SD,
  • 1 = 720p,
  • 2 = 1080p,
  • 3 = Highest Available
  • url (str) – URL of the video source, where the playable video can be extracted from.
  • quality (int) – [opt] Override YouTube.DL’s quality setting.
  • params – Optional “Keyword” arguments of YouTube.DL parameters.

The playable video url

Return type:


See also

The list of available parameters can be found at.