web_api module¶
Provide an easy and intuitive way to fetch data from streaming websites.
-
web_api._filter_stream(streams_, type_, quality, container)[source]¶ Look up the properties of the video streams and filter by keyword arguments. A certain level of interpretation is used, if the exact stream is not found. It will only return None if the container format is not provided.
Parameters: args (tuple(str)) – an arbitrary number of values. Last argument is the dict. Returns: True if all values were present, False otherwise. Return type: bool
-
web_api._playlist(plugin, media_url, **kwargs)[source]¶ Search for videos in a playlist.
Parameters: Returns: the search result.
Return type:
-
web_api.cache(func)[source]¶ A decorator function which caches the results of requests.
Parameters: func (callable) – the decorated function. Returns: the wrapper. Return type: callable
-
web_api.download(media_url, folder, audio=True, video=True, subtitles=False, **kwargs)[source]¶ Download the streams for the media url.
Parameters: Returns: a
Downloadinstance.
-
web_api.metadata(plugin, media_url)[source]¶ Fetch information for the specified media url and return a dict.
Parameters: media_url (str) – the url of the media page. Returns: all the information / metadata found. Return type: dict
-
web_api.module(func)[source]¶ A decorator function which provides the necessary plugin modules.
Parameters: func (callable) – the decorated function. Returns: the wrapper. Return type: callable
-
web_api.search(plugin, query_or_url, **kwargs)[source]¶ Perform a search and return the result. The result will be a list of dicts, each dict containing some basic data for the video like title, duration etc. The
query_or_urlparameter can either be a regular search time, in which case the plugin must be specified, or ot may be the url of a channel or playlist (where the plugin in determined automatically).Parameters: Returns: the search result.
Return type:
-
web_api.streams(media_url, quality='best', container='webm')[source]¶ Given a media url, return the stream dicts.
Parameters: Returns: the audio and video dicts.
Return type: