-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
551 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
# plugin.video.dlive | ||
DLive Livestreaming Addon for Kodi. | ||
[DLive](https://dlive.tv/) Livestreaming Addon for Kodi. | ||
|
||
Download the latest version from [here](https://github.com/lekma/plugin.video.dlive/releases/) | ||
([script.module.iapc](https://github.com/lekma/script.module.iapc/) is available | ||
[here](https://github.com/lekma/script.module.iapc/releases/)). | ||
|
||
Alternatively you can install [this repository](https://github.com/lekma/repository.lekma/) | ||
and install DLive from [Kodi](https://kodi.wiki/view/Add-on_manager#How_to_install_add-ons_from_a_repository). | ||
|
||
Download the latest version from [here](https://github.com/lekma/plugin.video.dlive/releases/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<addon id="plugin.video.dlive" | ||
name="DLive" | ||
version="0.1.2" | ||
version="0.2.0" | ||
provider-name="lekma"> | ||
|
||
<requires> | ||
<import addon="xbmc.python" version="2.26.0" /> | ||
<import addon="script.module.six" version="1.11.0" /> | ||
<import addon="script.module.kodi-six" version="0.1.2" /> | ||
<import addon="script.module.requests" version="2.22.0" /> | ||
<import addon="script.module.m3u8" version="0.3.7" /> | ||
<import addon="script.module.inputstreamhelper" version="0.4.3" /> | ||
<import addon="script.module.iapc" version="0.1.0" /> | ||
</requires> | ||
<extension point="xbmc.python.pluginsource" library="addon.py"> | ||
|
||
<extension point="xbmc.python.pluginsource" library="lib/plugin.py"> | ||
<provides>video</provides> | ||
</extension> | ||
|
||
<extension point="xbmc.service" library="lib/service.py" /> | ||
|
||
<extension point="xbmc.addon.metadata"> | ||
<reuselanguageinvoker>true</reuselanguageinvoker> | ||
<summary lang="en_GB">DLive Livestreaming Addon</summary> | ||
<description lang="en_GB">DLive Livestreaming Addon</description> | ||
<language>en</language> | ||
<license>GPL-3.0-only</license> | ||
<platform>all</platform> | ||
<source>https://github.com/lekma/plugin.video.dlive</source> | ||
<assets> | ||
<icon>resources/media/icon.png</icon> | ||
<fanart>resources/media/fanart.png</fanart> | ||
</assets> | ||
<summary lang="en_GB">DLive Livestreaming Addon</summary> | ||
<description lang="en_GB">DLive Livestreaming Addon</description> | ||
</extension> | ||
|
||
</addon> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
from __future__ import absolute_import, division, unicode_literals | ||
|
||
|
||
import objects | ||
from utils import notify | ||
from iapc import Client | ||
|
||
|
||
# ------------------------------------------------------------------------------ | ||
# Client | ||
# ------------------------------------------------------------------------------ | ||
|
||
class DLiveClient(object): | ||
|
||
_live_url_ = "https://live.prd.dlive.tv/hls/live/{username}.m3u8" | ||
|
||
_classes_ = { | ||
"stream": objects.User, | ||
"user": objects.User, | ||
"category": objects.Category, | ||
"featured": objects.Livestreams, | ||
"recommended": objects.Users, | ||
"streams": objects.Livestreams, | ||
"categories": objects.Categories, | ||
"search_users": objects.Users, | ||
"search_categories": objects.Categories | ||
} | ||
|
||
def __init__(self): | ||
self.client = Client() | ||
|
||
def query(self, key, _list_=False, **kwargs): | ||
cls, data = self._classes_[key], getattr(self.client, key)(**kwargs) | ||
if _list_: | ||
return cls(data["list"], **data["pageInfo"]) | ||
return cls(data) | ||
|
||
# -------------------------------------------------------------------------- | ||
|
||
def query_streams(self, **kwargs): | ||
return self.query("streams", _list_=True, **kwargs) | ||
|
||
# -------------------------------------------------------------------------- | ||
|
||
def stream(self, **kwargs): | ||
user = self.query("stream", **kwargs) | ||
if not user.livestream: | ||
return notify(30016, user.displayname) # Offline | ||
return user.livestream._item(self._live_url_.format(**kwargs)) | ||
|
||
def user(self, **kwargs): | ||
after = kwargs.get("after", "-1") | ||
user = self.query("user", **kwargs) | ||
return (user.livestream if after == "-1" else None, user.pastBroadcasts) | ||
|
||
def category(self, **kwargs): | ||
streams = self.query_streams(**kwargs) | ||
streams.category = self.query("category", **kwargs).title | ||
return streams | ||
|
||
# -------------------------------------------------------------------------- | ||
|
||
def featured(self, **kwargs): | ||
return self.query("featured", **kwargs) | ||
|
||
def recommended(self, **kwargs): | ||
return self.query("recommended", **kwargs) | ||
|
||
def streams(self, **kwargs): | ||
return self.query_streams(**kwargs) | ||
|
||
def categories(self, **kwargs): | ||
return self.query("categories", _list_=True, **kwargs) | ||
|
||
def search_users(self, **kwargs): | ||
return self.query("search_users", _list_=True, **kwargs) | ||
|
||
def search_categories(self, **kwargs): | ||
return self.query("search_categories", _list_=True, **kwargs) | ||
|
||
|
||
client = DLiveClient() | ||
|
Oops, something went wrong.