Skip to content

Commit

Permalink
Version [2.9.2]
Browse files Browse the repository at this point in the history
  • Loading branch information
I-am-PUID-0 committed Dec 12, 2024
1 parent 068357e commit 7e32c7f
Show file tree
Hide file tree
Showing 19 changed files with 1,107 additions and 147 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



## Version [2.9.2] - 2024-12-12 🚀

### Fixed 🐛

- [Issue #85](https://github.com/I-am-PUID-0/pd_zurg/issues/8 - Updated the default plex_debrid files to the latest changes from the [elfhosted](https://github.com/elfhosted/plex_debrid)


## Version [2.9.1] - 2024-09-03 🚀

### Fixed 🐛
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def shutdown(signum, frame):
def main():
logger = get_logger()

version = '2.9.1'
version = '2.9.2'

ascii_art = f'''
Expand Down
25 changes: 14 additions & 11 deletions plex_debrid/content/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def deviation(self, year=""):
return '(.*?)(' + title + ':?.)(series.|[^A-Za-z0-9]+)?((\(?' + str(self.year) + '\)?.)|(complete.)|(seasons?.[0-9]+.[0-9]?[0-9]?.?)|(S[0-9]+.S?[0-9]?[0-9]?.?)|(S[0-9]+E[0-9]+))'
elif self.type == 'season':
title = title.replace('.' + str(self.parentYear), '')
return '(.*?)(' + title + ':?.)(series.|[^A-Za-z0-9]+)?(\(?' + str(self.parentYear) + '\)?.)?(season.' + str(self.index) + '[^0-9]|season.' + str("{:02d}".format(self.index)) + '[^0-9]|S' + str("{:02d}".format(self.index)) + '[^0-9])'
return '(.*?)(' + title + ':?.)(series.|[^A-Za-z0-9]+)?(\(?' + str(self.parentYear) + '\)?.)?(season.' + str(self.index) + '[^0-9e]|season.' + str("{:02d}".format(self.index)) + '[^0-9e]|S' + str("{:02d}".format(self.index)) + '[^0-9e])'
elif self.type == 'episode':
title = title.replace('.' + str(self.grandparentYear), '')
try:
Expand Down Expand Up @@ -1166,10 +1166,13 @@ def download(self, retries=0, library=[], parentReleases=[]):
refresh_ = False
i = 0
self.Releases = []
if self.type in ["movie", "show"] and ((not hasattr(self, "title") or self.title == "" or self.title == None) or (not hasattr(self, "year") or self.year == None or self.year == "")):
ui_print(
"error: media item has no title or release year. This unknown movie/show might not be released yet.")
return
if self.type in ["movie", "show"]:
if not hasattr(self, "title") or self.title == "" or self.title is None:
ui_print("error: media item has no title. This unknown movie/show might not be released yet.")
return
elif not hasattr(self, "year") or self.year == "" or self.year is None:
ui_print(f"error: media item {self.title} has no release year. This movie/show might not be released yet.")
return
scraper.services.overwrite = []
EIDS = []
imdbID = "."
Expand Down Expand Up @@ -1535,7 +1538,7 @@ def debrid_download(self, force=False):
ver_dld = False
for release in copy.deepcopy(self.Releases):
self.Releases = [release,]
if hasattr(release, "cached") and len(release.cached) > 0:
if (hasattr(release, "cached") and len(release.cached) > 0) or (hasattr(release, "maybe_cached") and len(release.maybe_cached) > 0):
if debrid.download(self, stream=True, force=force):
self.downloaded()
downloaded += [True]
Expand Down Expand Up @@ -1594,16 +1597,16 @@ def bitrate(self):
def season_pack(self, releases):
season_releases = -1
episode_releases = [-2] * len(self.Episodes)
for release in self.Releases:
if len(release.cached) > 0 and int(release.resolution) > season_releases:
for release in self.Releases: # find the highest resolution of all the cached releases
if len(release.cached) + len(release.maybe_cached) > 0 and int(release.resolution) > season_releases:
season_releases = int(release.resolution)
for i, episode in enumerate(self.Episodes):
for i, episode in enumerate(self.Episodes): # find the highest resolution for each episode
ep_match = regex.compile(episode.deviation(), regex.IGNORECASE)
for release in releases:
if len(release.cached) > 0 and int(release.resolution) >= season_releases and int(release.resolution) > episode_releases[i] and ep_match.match(release.title):
if len(release.cached) + len(release.maybe_cached) > 0 and int(release.resolution) >= season_releases and int(release.resolution) > episode_releases[i] and ep_match.match(release.title):
episode_releases[i] = int(release.resolution)
lowest = 2160
for quality in episode_releases:
for quality in episode_releases: # find the lowest resolution of all the episodes
if quality < lowest:
lowest = quality
# If no cached episode release available for all episodes, or the quality is equal or lower to the cached season packs return True
Expand Down
10 changes: 6 additions & 4 deletions plex_debrid/content/services/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,21 +801,23 @@ def __new__(self,silent=False):
if section == '':
continue
section_response = []
section_title = ''
for type in types:
url = library.url + '/library/sections/' + section + '/all?type=' + type + '&X-Plex-Token=' + users[0][1]
response = get(url)
if hasattr(response, 'MediaContainer'):
if hasattr(response.MediaContainer, 'Metadata'):
for element in response.MediaContainer.Metadata:
section_response += [classes.media(element)]
if hasattr(response.MediaContainer, 'librarySectionTitle'):
section_title = response.MediaContainer.librarySectionTitle
if len(section_response) == 0:
ui_print("[plex error]: couldnt reach local plex library section '" + section + "' at server address: " + library.url + " - or this library really is empty.")
list_ = []
break
ui_print(f"[plex error]: local plex library section [{section}]: {section_title} at server address: {library.url} is empty!")
continue
else:
list_ += section_response
if len(list_) == 0:
ui_print("[plex error]: Your library seems empty. To prevent unwanted behaviour, no further downloads will be started. If your library really is empty, please add at least one media item manually.")
ui_print("[plex error]: No library items were found.")
shows = {}
seasons = {}
for item in list_:
Expand Down
4 changes: 2 additions & 2 deletions plex_debrid/debrid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def download(element, stream=True, query='', force=False):
if regex.search(t, release.source, regex.I):
release.cached = s
for service in services.get():
if service.short in release.cached:
if service.short in release.cached + release.maybe_cached:
if service.download(element, stream=stream, query=query, force=force):
downloaded = True
downloaded_files += element.Releases[0].files
Expand All @@ -47,7 +47,7 @@ def download(element, stream=True, query='', force=False):
release.cached = s
for service in services.get():
if len(release.cached) > 0:
if service.short in release.cached:
if service.short in release.cached + release.maybe_cached:
if service.download(element, stream=stream, query=query, force=force):
downloaded = True
downloaded_files += element.Releases[0].files
Expand Down
3 changes: 2 additions & 1 deletion plex_debrid/debrid/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
from debrid.services import premiumize
from debrid.services import debridlink
from debrid.services import putio
from debrid.services import torbox

#define subclass method
def __subclasses__():
return [realdebrid,alldebrid,premiumize,debridlink,putio]
return [realdebrid,alldebrid,premiumize,debridlink,putio,torbox]

active = []

Expand Down
Loading

0 comments on commit 7e32c7f

Please sign in to comment.