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
7 changed files
with
564 additions
and
564 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,57 +1,57 @@ | ||
from xbmcswift import Plugin | ||
import resources.lib.scraper as scraper | ||
|
||
plugin = Plugin('4Players Videos', 'plugin.video.4players', __file__) | ||
|
||
|
||
@plugin.route('/', default=True) | ||
def show_categories(): | ||
categories = scraper.getCategories() | ||
cat_ids = (30100, 30101, 30102, 30103, 30104, 30105, 30106, 30107, | ||
30108, 30109, 30110) | ||
items = [{'label': plugin.get_string(cat_ids[i]), | ||
'url': plugin.url_for('show_videos', | ||
category=category, page='1'), | ||
} for i, category in enumerate(categories)] | ||
return plugin.add_items(items) | ||
|
||
|
||
@plugin.route('/category/<category>/<page>/') | ||
def show_videos(category, page): | ||
videos, last_page_num = scraper.getVideos(category, page) | ||
items = [{'label': video['title'], | ||
'thumbnail': video['image'], | ||
'info': {'originaltitle': video['title'], | ||
'duration': video['length'], | ||
'date': video['date'], | ||
'rating': float(video['rating']), | ||
'votes': str(video['views'])}, | ||
'url': plugin.url_for('watch_video', url=video['url']), | ||
'is_folder': False, | ||
'is_playable': True, | ||
} for video in videos] | ||
if int(page) < int(last_page_num): | ||
next_page = str(int(page) + 1) | ||
items.append({'label': '>> %s %s >>' % (plugin.get_string(30001), | ||
next_page), | ||
'url': plugin.url_for('show_videos', | ||
category=category, | ||
page=next_page)}) | ||
if int(page) > 1: | ||
prev_page = str(int(page) - 1) | ||
items.insert(0, {'label': '<< %s %s <<' % (plugin.get_string(30001), | ||
prev_page), | ||
'url': plugin.url_for('show_videos', | ||
category=category, | ||
page=prev_page)}) | ||
return plugin.add_items(items) | ||
|
||
|
||
@plugin.route('/watch/<url>/') | ||
def watch_video(url): | ||
video_url = scraper.getVideoFile(url) | ||
return plugin.set_resolved_url(video_url) | ||
|
||
|
||
if __name__ == '__main__': | ||
plugin.run() | ||
from xbmcswift import Plugin | ||
import resources.lib.scraper as scraper | ||
|
||
plugin = Plugin('4Players Videos', 'plugin.video.4players', __file__) | ||
|
||
|
||
@plugin.route('/', default=True) | ||
def show_categories(): | ||
categories = scraper.getCategories() | ||
cat_ids = (30100, 30101, 30102, 30103, 30104, 30105, 30106, 30107, | ||
30108, 30109, 30110) | ||
items = [{'label': plugin.get_string(cat_ids[i]), | ||
'url': plugin.url_for('show_videos', | ||
category=category, page='1'), | ||
} for i, category in enumerate(categories)] | ||
return plugin.add_items(items) | ||
|
||
|
||
@plugin.route('/category/<category>/<page>/') | ||
def show_videos(category, page): | ||
videos, last_page_num = scraper.getVideos(category, page) | ||
items = [{'label': video['title'], | ||
'thumbnail': video['image'], | ||
'info': {'originaltitle': video['title'], | ||
'duration': video['length'], | ||
'date': video['date'], | ||
'rating': float(video['rating']), | ||
'votes': str(video['views'])}, | ||
'url': plugin.url_for('watch_video', url=video['url']), | ||
'is_folder': False, | ||
'is_playable': True, | ||
} for video in videos] | ||
if int(page) < int(last_page_num): | ||
next_page = str(int(page) + 1) | ||
items.append({'label': '>> %s %s >>' % (plugin.get_string(30001), | ||
next_page), | ||
'url': plugin.url_for('show_videos', | ||
category=category, | ||
page=next_page)}) | ||
if int(page) > 1: | ||
prev_page = str(int(page) - 1) | ||
items.insert(0, {'label': '<< %s %s <<' % (plugin.get_string(30001), | ||
prev_page), | ||
'url': plugin.url_for('show_videos', | ||
category=category, | ||
page=prev_page)}) | ||
return plugin.add_items(items) | ||
|
||
|
||
@plugin.route('/watch/<url>/') | ||
def watch_video(url): | ||
video_url = scraper.getVideoFile(url) | ||
return plugin.set_resolved_url(video_url) | ||
|
||
|
||
if __name__ == '__main__': | ||
plugin.run() |
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,18 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<addon id="plugin.video.4players" name="4Players Videos" version="1.1.0" provider-name="Tristan Fischer (sphere)"> | ||
<requires> | ||
<import addon="xbmc.python" version="2.0"/> | ||
<import addon="script.module.beautifulsoup" version="3.0.8"/> | ||
<import addon="script.module.xbmcswift" version="0.2.0"/> | ||
</requires> | ||
<extension point="xbmc.python.pluginsource" library="addon.py"> | ||
<provides>video</provides> | ||
</extension> | ||
<extension point="xbmc.addon.metadata"> | ||
<platform>all</platform> | ||
<summary lang="de">Computerspiel-Videos und -Trailer von www.4players.de</summary> | ||
<summary lang="en">Watch game videos and trailers from www.4players.de</summary> | ||
<description lang="de">Bietet aktuelle Videos und Trailer zu Computer- und Konsolenspielen von der Webseite www.4players.de</description> | ||
<description lang="en">You can watch all computer- and console-game videos and trailers from the german website www.4players.de</description> | ||
</extension> | ||
</addon> | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<addon id="plugin.video.4players" name="4Players Videos" version="1.1.0" provider-name="Tristan Fischer (sphere)"> | ||
<requires> | ||
<import addon="xbmc.python" version="2.0"/> | ||
<import addon="script.module.beautifulsoup" version="3.0.8"/> | ||
<import addon="script.module.xbmcswift" version="0.2.0"/> | ||
</requires> | ||
<extension point="xbmc.python.pluginsource" library="addon.py"> | ||
<provides>video</provides> | ||
</extension> | ||
<extension point="xbmc.addon.metadata"> | ||
<platform>all</platform> | ||
<summary lang="de">Computerspiel-Videos und -Trailer von www.4players.de</summary> | ||
<summary lang="en">Watch game videos and trailers from www.4players.de</summary> | ||
<description lang="de">Bietet aktuelle Videos und Trailer zu Computer- und Konsolenspielen von der Webseite www.4players.de</description> | ||
<description lang="en">You can watch all computer- and console-game videos and trailers from the german website www.4players.de</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
1.1.0 | ||
1.1.0 | ||
First Version for Eden-pre xbmc.org addon-repository |
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,15 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<strings> | ||
<string id="30001">Page</string> | ||
<string id="30100">All</string> | ||
<string id="30101">Most viewed</string> | ||
<string id="30102">Best rated</string> | ||
<string id="30103">PC</string> | ||
<string id="30104">PlayStation 2</string> | ||
<string id="30105">PlayStation 3</string> | ||
<string id="30106">Wii</string> | ||
<string id="30107">Xbox 360</string> | ||
<string id="30108">Nintendo DS</string> | ||
<string id="30109">PlayStation Portable</string> | ||
<string id="30110">Video-Fazit</string> | ||
</strings> | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<strings> | ||
<string id="30001">Page</string> | ||
<string id="30100">All</string> | ||
<string id="30101">Most viewed</string> | ||
<string id="30102">Best rated</string> | ||
<string id="30103">PC</string> | ||
<string id="30104">PlayStation 2</string> | ||
<string id="30105">PlayStation 3</string> | ||
<string id="30106">Wii</string> | ||
<string id="30107">Xbox 360</string> | ||
<string id="30108">Nintendo DS</string> | ||
<string id="30109">PlayStation Portable</string> | ||
<string id="30110">Video-Fazit</string> | ||
</strings> |
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,15 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<strings> | ||
<string id="30001">Seite</string> | ||
<string id="30100">Alle</string> | ||
<string id="30101">Am meisten gesehen</string> | ||
<string id="30102">Am besten bewertet</string> | ||
<string id="30103">PC</string> | ||
<string id="30104">PlayStation 2</string> | ||
<string id="30105">PlayStation 3</string> | ||
<string id="30106">Wii</string> | ||
<string id="30107">Xbox 360</string> | ||
<string id="30108">Nintendo DS</string> | ||
<string id="30109">PlayStation Portable</string> | ||
<string id="30110">Video-Fazit</string> | ||
</strings> | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<strings> | ||
<string id="30001">Seite</string> | ||
<string id="30100">Alle</string> | ||
<string id="30101">Am meisten gesehen</string> | ||
<string id="30102">Am besten bewertet</string> | ||
<string id="30103">PC</string> | ||
<string id="30104">PlayStation 2</string> | ||
<string id="30105">PlayStation 3</string> | ||
<string id="30106">Wii</string> | ||
<string id="30107">Xbox 360</string> | ||
<string id="30108">Nintendo DS</string> | ||
<string id="30109">PlayStation Portable</string> | ||
<string id="30110">Video-Fazit</string> | ||
</strings> |
Oops, something went wrong.