Skip to content

Commit

Permalink
[script.plexmod] 0.7.6 (#2571)
Browse files Browse the repository at this point in the history
* [script.plexmod] 0.7.3

* [script.plexmod] 0.7.5

* [script.plexmod] 0.7.6
  • Loading branch information
pannal authored Apr 3, 2024
1 parent f84e651 commit 730cc50
Show file tree
Hide file tree
Showing 460 changed files with 91,636 additions and 0 deletions.
492 changes: 492 additions & 0 deletions script.plexmod/LICENSE.txt

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions script.plexmod/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# PlexMod (for Kodi)

This is a modification of the official open-source Plex client for Kodi "plex-for-kodi" (Plex4Kodi) semi-maintained by me (pannal).

Contrary to how this repository was handled before, this client does _not_ claim to adhere to the Plex Inc. design guidelines, all the time.

It implements features that are not implemented in other official Plex clients and may implement others in non-conform ways.

It is still based off of the original P4K source and critical bugfixes will be PR'd back.

## Active branches
* [develop-kodi21](https://github.com/pannal/plex-for-kodi/tree/develop_kodi21) (Kodi 19, 20, 21 cross-compatible)
* [develop-kodi18](https://github.com/pannal/plex-for-kodi/tree/develop_kodi18) (legacy)

Master branch is based off of the official plex-for-kodi master branch.

## Installation

### Via repository
* Add `https://pannal.github.io/dontpanickodi/` to your Kodi installation as a file source
* Go back to addons, choose zip file, choose the file source you added and install the repository
* Install Plex via Addons->Install from repository->Don’t Panic->Video add-ons->Plex
* Optional, recommended: Install Plextuary via Addons->Install from repository->Don’t Panic->Look and Feel->Skin->Plextuary

### Manual
* Checkout any branch of this GitHub repository, rename to `script.plexmod` and use as an addon


## Help/Bug Reports
https://forums.plex.tv/t/plexmod-for-kodi-18-19-20-21/481208

## License
[LICENSE](https://github.com/plexinc/plex-for-kodi/blob/master/LICENSE.txt)
43 changes: 43 additions & 0 deletions script.plexmod/addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.plexmod"
name="PM4K for Plex"
version="0.7.6"
provider-name="pannal">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.requests" version="2.27.1+matrix.1"/>
<import addon="script.module.six" version="1.15.0+matrix.1"/>
<import addon="script.module.kodi-six" version="0.1.3.1" />
</requires>
<extension point="xbmc.python.script" library="default.py">
<provides>video</provides>
</extension>
<extension point="xbmc.python.pluginsource" library="plugin.py">
<provides>executable</provides>
</extension>
<extension point="xbmc.service" library="service.py" />
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">PlexMod for Kodi</summary>
<summary lang="es_ES">PlexMod para Kodi</summary>
<summary lang="de_DE">PlexMod für Kodi</summary>
<description lang="en_GB">Unofficial Plex for Kodi add-on</description>
<description lang="es_ES">Complemento no oficial de Plex para Kodi</description>
<description lang="de_DE">Inoffizielles Plex für Kodi add-on</description>
<disclaimer lang="en">This add-on is not supported by Plex</disclaimer>
<disclaimer lang="es">Este add-on no está respaldado por Plex</disclaimer>
<disclaimer lang="de">Dieses Addon wird nicht von der Firma Plex Inc. unterstützt</disclaimer>

<license>GPL-2.0-only</license>
<forum>https://forums.plex.tv/t/plexmod-for-kodi-18-19-20-21/481208</forum>
<website>https://www.plex.tv</website>
<source>https://github.com/pannal/plex-for-kodi</source>
<platform>all</platform>
<news>
- Based on 0.7.6-rev2
</news>
<assets>
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
</assets>
</extension>
</addon>
791 changes: 791 additions & 0 deletions script.plexmod/changelog.txt

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions script.plexmod/default.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from __future__ import absolute_import
from lib import main


main.main()
Binary file added script.plexmod/fanart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added script.plexmod/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions script.plexmod/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from __future__ import absolute_import
import requests

# Disable some warnings. These are not security issue warnings, but alerts to issues that may cause errors
try:
from requests.packages.urllib3.exceptions import InsecurePlatformWarning
requests.packages.urllib3.disable_warnings(InsecurePlatformWarning)
except:
import traceback
traceback.print_exc()

try:
from requests.packages.urllib3.exceptions import SNIMissingWarning
requests.packages.urllib3.disable_warnings(SNIMissingWarning)
except:
# probably urllib3 >= 2.1.0
pass

from . import compat
from . import _included_packages
8 changes: 8 additions & 0 deletions script.plexmod/lib/_included_packages/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import absolute_import
import os
import sys
import inspect

cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]))
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
44 changes: 44 additions & 0 deletions script.plexmod/lib/_included_packages/icmplib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'''
icmplib
~~~~~~~
Easily forge ICMP packets and make your own ping and traceroute.
https://github.com/ValentinBELYN/icmplib
:copyright: Copyright 2017-2023 Valentin BELYN.
:license: GNU LGPLv3, see the LICENSE for details.
~~~~~~~
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
<https://www.gnu.org/licenses/>.
'''

from .sockets import ICMPv4Socket, ICMPv6Socket, AsyncSocket
from .models import ICMPRequest, ICMPReply, Host, Hop
from .ping import ping, async_ping
from .multiping import multiping, async_multiping
from .traceroute import traceroute
from .exceptions import *
from .utils import is_hostname, is_ipv4_address, is_ipv6_address
from .utils import PID, resolve, async_resolve


__author__ = 'Valentin BELYN'
__copyright__ = 'Copyright 2017-2023 Valentin BELYN'
__license__ = 'GNU Lesser General Public License v3.0'

__version__ = '3.0.4'
__build__ = '231010'
214 changes: 214 additions & 0 deletions script.plexmod/lib/_included_packages/icmplib/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
'''
icmplib
~~~~~~~
Easily forge ICMP packets and make your own ping and traceroute.
https://github.com/ValentinBELYN/icmplib
:copyright: Copyright 2017-2023 Valentin BELYN.
:license: GNU LGPLv3, see the LICENSE for details.
~~~~~~~
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
<https://www.gnu.org/licenses/>.
'''


class ICMPLibError(Exception):
'''
Exception class for the icmplib package.
'''


class NameLookupError(ICMPLibError):
'''
Raised when the requested name does not exist or cannot be resolved.
This concerns both Fully Qualified Domain Names and hostnames.
'''
def __init__(self, name):
message = f'The name \'{name}\' cannot be resolved'
super().__init__(message)


class ICMPSocketError(ICMPLibError):
'''
Base class for ICMP sockets exceptions.
'''


class SocketAddressError(ICMPSocketError):
'''
Raised when the requested address cannot be assigned to the socket.
'''
def __init__(self, address):
message = f'The requested address ({address}) cannot be ' \
'assigned to the socket'
super().__init__(message)


class SocketPermissionError(ICMPSocketError):
'''
Raised when the privileges are insufficient to create the socket.
'''
def __init__(self, privileged):
if privileged:
message = 'Root privileges are required to create the socket'
else:
message = 'A prior configuration of your OS is required ' \
'to use ICMP sockets without root privileges. ' \
'Read more on https://github.com/ValentinBELYN' \
'/icmplib'

super().__init__(message)


class SocketUnavailableError(ICMPSocketError):
'''
Raised when an action is performed while the socket is closed.
'''
def __init__(self):
message = 'The socket can no longer be used after its closure'
super().__init__(message)


class SocketBroadcastError(ICMPSocketError):
'''
Raised when a broadcast address is used and the corresponding option
is not enabled on the socket.
'''
def __init__(self):
message = 'Broadcast is not allowed: ' \
'please use the \'broadcast\' property to allow it'
super().__init__(message)


class TimeoutExceeded(ICMPSocketError):
'''
Raised when a timeout occurs on a socket.
'''
def __init__(self, timeout):
message = f'The timeout has been reached ({timeout}s)'
super().__init__(message)


class ICMPError(ICMPLibError):
'''
Base class for ICMP error messages.
'''
def __init__(self, message, reply):
super().__init__(message)
self._reply = reply

@property
def reply(self):
return self._reply


class DestinationUnreachable(ICMPError):
'''
Base class for ICMP Destination Unreachable messages.
Destination Unreachable message is generated by the host or its
inbound gateway to inform the client that the destination is
unreachable for some reason.
'''
_CODES = {}

def __init__(self, reply):
if reply.code in self._CODES:
message = self._CODES[reply.code]
else:
message = f'Destination unreachable, bad code: {reply.code}'

super().__init__(message, reply)


class ICMPv4DestinationUnreachable(DestinationUnreachable):
_CODES = {
0: 'Destination network unreachable',
1: 'Destination host unreachable',
2: 'Destination protocol unreachable',
3: 'Destination port unreachable',
4: 'Fragmentation needed and DF set',
5: 'Source route failed',
6: 'Destination network unknown',
7: 'Destination host unknown',
8: 'Source host isolated',
9: 'Destination network prohibed',
10: 'Destination host prohibed',
11: 'Destination network unreachable for ToS',
12: 'Destination host unreachable for ToS',
13: 'Packet filtered',
14: 'Precedence violation',
15: 'Precedence cutoff'
}


class ICMPv6DestinationUnreachable(DestinationUnreachable):
_CODES = {
0: 'No route to destination',
1: 'Communication with destination administratively prohibited',
2: 'Beyond scope of source address',
3: 'Address unreachable',
4: 'Port unreachable',
5: 'Source address failed ingress/egress policy',
6: 'Reject route to destination'
}


class TimeExceeded(ICMPError):
'''
Base class for ICMP Time Exceeded messages.
Time Exceeded message is generated by a gateway to inform the source
of a discarded datagram due to the time to live field reaching zero.
A Time Exceeded message may also be sent by a host if it fails to
reassemble a fragmented datagram within its time limit.
'''
_CODES = {}

def __init__(self, reply):
if reply.code in self._CODES:
message = self._CODES[reply.code]
else:
message = f'Time exceeded, bad code: {reply.code}'

super().__init__(message, reply)


class ICMPv4TimeExceeded(TimeExceeded):
_CODES = {
0: 'Time to live exceeded',
1: 'Fragment reassembly time exceeded'
}


class ICMPv6TimeExceeded(TimeExceeded):
_CODES = {
0: 'Hop limit exceeded',
1: 'Fragment reassembly time exceeded'
}
Loading

0 comments on commit 730cc50

Please sign in to comment.