Add-on:Simple Downloader for xbmc plugins: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>NedBot
m (Wikipedia python library; cosmetic changes)
m (Addon-Bot repo category update)
Tag: Manual revert
 
(120 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Addon  
{{Addon  
|Name=Simple downloader for xbmc plugins.
|Name=Simple Downloader for xbmc plugins
|provider-name=TheCollective
|provider-name=TheCollective
|ID=script.module.simple.downloader
|ID=script.module.simple.downloader
|latest-version=0.9.0
|latest-version=1.9.5
|extension point=xbmc.python.module
|extension point=xbmc.service
|provides=
|provides=
|Summary=Simple downloader for xbmc plugins.
|Summary=Simple downloader for xbmc plugins.
|Description=
|Description=
|Platform=all
|Platform=all
|icon url=}}
|Language=
|License=
|Forum=
|Website=
|Source=
|Email=
|broken=
|icon url=http://mirrors.kodi.tv/addons/leia/script.module.simple.downloader/icon.png}}


= Introduction =
= Introduction =
Line 17: Line 24:
* One queue across all plugins
* One queue across all plugins
* Requeing an existing item moves it to the front of the queue.
* Requeing an existing item moves it to the front of the queue.
* RTMP downloading if the rtmpdump binary is installed.
* RTSP/mms downloading if the vlc or mplayer binary is installed.(And any other stream they accept)
[[File:Simple_downloader.png|900px| Simple Downloader]]
= Testing/Status =
Integration and unittests are run continously by Jenkins
http://tc.tobiasussing.dk/jenkins/view/Simple%20Downloader/


= Developers =
= Developers =
This service works as an independant storage server to XBMC's implementation.
This is a unified cross plugin http/rtmp downloader.
 
It is currently not possible to distribute the rtmpdump binary with this addon.
 
The user must make sure rtmpdump is installed in a system PATH for rtmp downloading to work.


It provides proper thread safe locking and storage management.
Development and support thread: http://forum.kodi.tv/showthread.php?t=116500


== Setup ==
== Setup ==
To use the cacheing service add the following to your py file.
To use the downloader edit your addon.xml like this.
 
  <requires>
    <import addon="xbmc.python" version="2.0"/>
    <import addon="script.module.simple.downloader" version="1.9.5"/> # Add this
  </requires>
 
And add the following to your py file.


  import xbmc, xbmcvfs, xbmcaddon
  settings = xbmcaddon.Addon(id='your.plugin.id') # The same as in addon.xml
   import SimpleDownloader as downloader
   import SimpleDownloader as downloader
   downloader = downloader.SimpleDownloader()
   downloader = downloader.SimpleDownloader()


You can now access the caching service through the "cache" variable.
You can now access the downloader through the "downloader" variable.


Remember to include a fallback [http://hg.tobiasussing.dk/hgweb.cgi/youtubexbmc/file/21b17fff9eea/storageserverdummy.py storageserverdummy.py] file.
== Debugging ==
To enable debugging set the following values in your default.py
 
dbg = True # Default


=== Settings ===
Or you can change it after import with.
In your resources/settings.xml you need the following.


    <setting id="downloadPath" type="folder" label="Download Location" default="" />
downloader.dbg = True # Default
    <setting id="hideDuringPlayback" type="bool" label="Hide during playback" default="true" />
    <setting id="notification_length" type="enum" label="Notification length in seconds" values="1|2|3|4|5|6|7|8|9|10" default="2" />


== Debugging ==
Whenever you debug your own code you should also debug in the cache. Otherwise you should remember to DISABLE it.
To enable debugging set the following values in default.py


dbg = True # Default
== download(self, filename, dict = {}) ==
Takes filename(string) and dictionary list with url and download_path.


Whenever you debug your own code you should also debug in the cache. Otherwise you should remember to DISABLE it.
The filename must be unique.


== downloadVideo(self, params = {}) ==
Input dictinary variables:
Takes dictionary list with video name and url.
* url(string): URL to download
* Title(string): Title to give download. Use filename if not set.
* download_path(string): Path to store file in
* live(bool): Set to True when streaming rtmp live.
* duration(int): Duration in minutes to download(For live streams).


Returns None
Returns None


   params = {}  
A simple http download
   params["video_url"] = "http://server.com/video.mp4"
   params = { "url": "http://server.com/video.mp4", "download_path": "/tmp" }
   params["Title"] = "my video"
   downloader.download("myvideo.mp4", params)
   self.downloader.downloadVideo(params)
 
A simple http download with a custom title.
  params = { "url": "http://server.com/video.mp4", "download_path": "/tmp", "Title": "my video" }
   downloader.download("myvideo.mp4", params)
 
A simple RTMP download
  params = {"url": "rtmp://edge01.fms.dutchview.nl/botr/bunny", "download_path": "/tmp", "Title": "bunny"}
  downloader.download("bunny.mp4", params)
 
A simple RTMP Live download
  video = {"url": "rtmp://aljazeeraflashlivefs.fplive.net:1935/aljazeeraflashlive-live/aljazeera_english_1", "download_path": "/tmp", "Title": "Live Download", "live": "true", "duration": "10"}
   downloader.download("aljazeera-10minutes.mp4", params)
 
== isRTMPInstalled() ==
Returns True if rtmpdump is installed
 
== isVLCInstalled() ==
Returns True if vlc is installed
 
== isMPlayerInstalled() ==
Returns True if mplayer is installed


[[Category:Repo: Eden-pre]]
[[Category:All add-ons]]
[[Category:Service add-ons]]
[[Category:Gotham add-on repository]]
[[Category:Helix add-on repository]]
[[Category:Isengard add-on repository]]
[[Category:Jarvis add-on repository]]
[[Category:Krypton add-on repository]]
[[Category:Leia add-on repository]]

Latest revision as of 04:23, 17 October 2021

Simple Downloader for xbmc plugins
icon.png

See this add-on on the kodi.tv showcase

Author: TheCollective

Type: Services
Repo:

Summary: Simple downloader for xbmc plugins.
Home icon grey.png   ▶ Add-ons ▶ Simple Downloader for xbmc plugins

Installing

This add-on is installed from the Add-on browser located in Kodi as follows:

  1. Settings
  2. Add-ons
  3. Install from repository
  4. Services
  5. Simple Downloader for xbmc plugins
  6. Install

Introduction

This is a downloader developed and used with the YouTube and BlipTV addons.

Features

  • One queue across all plugins
  • Requeing an existing item moves it to the front of the queue.
  • RTMP downloading if the rtmpdump binary is installed.
  • RTSP/mms downloading if the vlc or mplayer binary is installed.(And any other stream they accept)

Simple Downloader

Testing/Status

Integration and unittests are run continously by Jenkins

http://tc.tobiasussing.dk/jenkins/view/Simple%20Downloader/

Developers

This is a unified cross plugin http/rtmp downloader.

It is currently not possible to distribute the rtmpdump binary with this addon.

The user must make sure rtmpdump is installed in a system PATH for rtmp downloading to work.

Development and support thread: http://forum.kodi.tv/showthread.php?t=116500

Setup

To use the downloader edit your addon.xml like this.

 <requires>
   <import addon="xbmc.python" version="2.0"/>
   <import addon="script.module.simple.downloader" version="1.9.5"/> # Add this
 </requires>

And add the following to your py file.

 import SimpleDownloader as downloader
 downloader = downloader.SimpleDownloader()

You can now access the downloader through the "downloader" variable.

Debugging

To enable debugging set the following values in your default.py

dbg = True # Default

Or you can change it after import with.

downloader.dbg = True # Default

Whenever you debug your own code you should also debug in the cache. Otherwise you should remember to DISABLE it.

download(self, filename, dict = {})

Takes filename(string) and dictionary list with url and download_path.

The filename must be unique.

Input dictinary variables:

  • url(string): URL to download
  • Title(string): Title to give download. Use filename if not set.
  • download_path(string): Path to store file in
  • live(bool): Set to True when streaming rtmp live.
  • duration(int): Duration in minutes to download(For live streams).

Returns None

A simple http download

 params = { "url": "http://server.com/video.mp4", "download_path": "/tmp" }
 downloader.download("myvideo.mp4", params)

A simple http download with a custom title.

 params = { "url": "http://server.com/video.mp4", "download_path": "/tmp", "Title": "my video" }
 downloader.download("myvideo.mp4", params)

A simple RTMP download

 params = {"url": "rtmp://edge01.fms.dutchview.nl/botr/bunny", "download_path": "/tmp", "Title": "bunny"}
 downloader.download("bunny.mp4", params)

A simple RTMP Live download

 video = {"url": "rtmp://aljazeeraflashlivefs.fplive.net:1935/aljazeeraflashlive-live/aljazeera_english_1", "download_path": "/tmp", "Title": "Live Download", "live": "true", "duration": "10"}
 downloader.download("aljazeera-10minutes.mp4", params)

isRTMPInstalled()

Returns True if rtmpdump is installed

isVLCInstalled()

Returns True if vlc is installed

isMPlayerInstalled()

Returns True if mplayer is installed