Skip to content

Commit

Permalink
Fixed issue #35 - Compatibility with Kodi Matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
gdomenici-verimatrix committed Jun 24, 2021
1 parent 4dd9964 commit 0df66e3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Kodi video plugin that provides video streaming from a https://www.pcloud.com (free or paid) account.

For Kodi Helix (14.x) and greater).
For Kodi Matrix (19.x) and greater).
21 changes: 10 additions & 11 deletions addon.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import resources.lib.pcloudapi
from resources.lib.loginfailedexception import LoginFailedException
import sys
import xbmcplugin
import xbmcgui
import xbmcplugin
import xbmcaddon
from datetime import datetime, timedelta
import time
Expand All @@ -13,12 +13,12 @@
from urllib.parse import quote, unquote, parse_qs
else:
# Python 2 stuff
from urllib import quote, unquote
from urlparse import parse_qs
from urllib.parse import quote, unquote
from urllib.parse import parse_qs

myAddon = xbmcaddon.Addon()

base_url = sys.argv[0] # The base URL of your add-on, e.g. 'plugin://plugin.video.pcloud-video-streaming/'
base_url = sys.argv[0] # The base URL of your add-on, e.g. 'plugin://plugin.video.pcloud-video-streaming/'
addon_handle = int(sys.argv[1]) # The process handle for this add-on, as a numeric string
xbmcplugin.setContent(addon_handle, 'movies')

Expand Down Expand Up @@ -154,16 +154,15 @@ def AuthenticateToPCloud():
filename = oneFileOrFolderItem["name"]
if oneFileOrFolderItem["isfolder"]:
li = xbmcgui.ListItem(filename)
li.setIconImage("DefaultFolder.png")
li.setArt("DefaultFolder.png")
# Add context menu item for "delete folder"
deleteActionMenuText = myAddon.getLocalizedString(30114) # "Delete from PCloud..."
deleteActionUrl = base_url + "?mode=delete&folderID=" + str(oneFileOrFolderItem["folderid"]) + "&filename=" + quote(oneFileOrFolderItem["name"].encode("utf-8"))
li.addContextMenuItems(
[(deleteActionMenuText, "RunPlugin(" + deleteActionUrl + ")")])
# Finally add the list item to the directory
url = base_url + "?mode=folder&folderID=" + str(oneFileOrFolderItem["folderid"])
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,
listitem=li, isFolder=True)
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=True)
else:
contentType = oneFileOrFolderItem["contenttype"]
xbmc.log ("contentType is: ")
Expand All @@ -181,7 +180,7 @@ def AuthenticateToPCloud():
elif contentType[:6] == "audio/":
thumbnailUrl = "DefaultAlbumCover.png"
li = xbmcgui.ListItem(filename)
li.setIconImage(thumbnailUrl)
li.setArt(thumbnailUrl)
if contentType[:6] == "video/":
li.addStreamInfo(
"video",
Expand Down Expand Up @@ -226,7 +225,7 @@ def AuthenticateToPCloud():
# "My Shares" (in a different color)
mySharesFolderText = "[COLOR blue]{0}[/COLOR]".format(myAddon.getLocalizedString(30122))
li = xbmcgui.ListItem(mySharesFolderText)
li.setIconImage("DefaultFolder.png")
li.setArt("DefaultFolder.png")
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=True)
else:
# now add "go up one level" fake directory if we're NOT in the root folder
Expand All @@ -235,7 +234,7 @@ def AuthenticateToPCloud():
# "Back to parent folder"
parentFolderText = "--[I]{0}[/I]".format(myAddon.getLocalizedString(30113))
li = xbmcgui.ListItem(parentFolderText)
li.setIconImage("DefaultFolder.png")
li.setArt("DefaultFolder.png")
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=True)
else:
# if we're in the "My Shares" folder, add "go to my pCloud (root folder)" virtual directory
Expand All @@ -244,7 +243,7 @@ def AuthenticateToPCloud():
# "Back to My pCloud"
parentFolderText = "[I]{0}[/I]".format(myAddon.getLocalizedString(30123))
li = xbmcgui.ListItem(parentFolderText)
li.setIconImage("DefaultFolder.png")
li.setArt("DefaultFolder.png")
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=True)

# Add various sort methods
Expand Down
8 changes: 6 additions & 2 deletions addon.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.pcloud-video-streaming" name="PCloud Video Streaming" version="1.4.2" provider-name="Guido Domenici">
<addon id="plugin.video.pcloud-video-streaming" name="PCloud Video Streaming" version="1.4.5" provider-name="Guido Domenici, updated for Kodi Matrix by Carneal">
<requires>
<import addon="xbmc.python" version="2.19.0"/>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
<!-- addon.py, below, is the entry point -->
<extension point="xbmc.python.pluginsource" library="addon.py">
Expand All @@ -20,5 +20,9 @@
<website>https://github.com/gdomenici/plugin.video.pcloud-video-streaming/wiki</website>
<email>guido.domenici@gmail.com</email>
<source>https://github.com/gdomenici/plugin.video.pcloud-video-streaming</source>
<assets>
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
</assets>
</extension>
</addon>
22 changes: 11 additions & 11 deletions changelog.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
v1.5.0 -- 24-Jun-2021
- Changes required for compatibility with Kodi Matrix
- Updated xbmc.python to version="3.0.0"
- xbmcgui.ListItem no longer has attribute "setIconImage" so converted to "setArt"
- Changes courtesy of Carneal

v1.4.2 -- 07-Jun-2020
- Fixed issue #27: In certain locales (such as en-nz), the "Back to parent folder" list item would sort
after folders starting with a number. Now it sorts correctly at the top of the list.
- Fixed issue #27: In certain locales (such as en-nz), the "Back to parent folder" list item would sort after folders starting with a number. Now it sorts correctly at the top of the list.

v1.4.1 -- 27-Mar-2020
- Now also made available as a Music add-on.
Expand All @@ -15,21 +20,16 @@ v1.3.1 -- 24-Nov-2019
- Removed superfluous files.

v1.3.0 -- 21-Nov-2019
- Fixed issue #21: now the add-on runs with Python 3, used in Kodi 19 and higher, as well as Python 2,
used in all previous Kodi versions.
- Fixed issue #21: now the add-on runs with Python 3, used in Kodi 19 and higher, as well as Python 2, used in all previous Kodi versions.

v1.2.11 -- 03-Dec-2018
- Fixed issue #18: if the PCloud username (i.e. the email address) contained nonstandard symbols such as
for example a "+", logon would fail.
- Fixed issue #18: if the PCloud username (i.e. the email address) contained nonstandard symbols such as for example a "+", logon would fail.

v1.2.10 -- 01-Dec-2018
- Fixed issue #17: if a folder contained a large amount of files (typically, 500+), its contents could not
be shown.
- Fixed issue #17: if a folder contained a large amount of files (typically, 500+), its contents could not be shown.

v1.2.9 -- 29-Apr-2018
- Fixed issue #13: if a subtitle file is present in the same folder with the same filename (but different
extension, such as for example .srt) as an existing video file, then those subtitles will be shown along
with the video.
- Fixed issue #13: if a subtitle file is present in the same folder with the same filename (but different extension, such as for example .srt) as an existing video file, then those subtitles will be shown along with the video.

v1.2.8 -- 04-Jan-2018
- Can now show pictures in addition to the other content types.
Expand Down

0 comments on commit 0df66e3

Please sign in to comment.