Giter Site home page Giter Site logo

Comments (11)

JPH71 avatar JPH71 commented on June 25, 2024

from pgma-modernized.

CodyBerenson avatar CodyBerenson commented on June 25, 2024

@JPH71 He is referring to GAnfoMoviesImporter.bundle that is part of our repository. Not one of the agents that you created, its a widely distributed "catch-all" agent in which Plex consumes the metadata in a properly formatted NFO files that are matched to a similarly named movie in a folder. Requires the use also of the local assets agent.

@minielim would you upload your .NFO and I'll take a look and do some testing? Have you been successful with other .NFOs with other titles? I just tested a .NFO and it worked fine, so it would be really helpful to see your .NFO. Since we didn't create the agent, I'm not sure how much support we can offer for the agent....

from pgma-modernized.

minielim avatar minielim commented on June 25, 2024

The NFO files are xml documents which provide information in a format mostly from xbmc. I had been successfully using them in cases where the other scrapers aren't picking up things as expected. (In this case, the IAFD scraper doesn't seem to support stacked movies.)

If I apply this quick-and-dirty test change:

diff --git a/GAnfoMoviesImporter.bundle/Contents/Code/__init__.py b/GAnfoMoviesImporter.bundle/Contents/Code/__init__.py
index 5e2ddc5..2c916d6 100644
--- a/GAnfoMoviesImporter.bundle/Contents/Code/__init__.py
+++ b/GAnfoMoviesImporter.bundle/Contents/Code/__init__.py
@@ -1108,6 +1108,21 @@ def get_related_files(video_file, file_extension):
 MOVIE_NAME_REGEX = re.compile(r' \(.*\)')


+def splitall(path):
+    allparts = []
+    while 1:
+        parts = os.path.split(path)
+        if parts[0] == path:  # sentinel for absolute paths
+            allparts.insert(0, parts[0])
+            break
+        elif parts[1] == path: # sentinel for relative paths
+            allparts.insert(0, parts[1])
+            break
+        else:
+            path = parts[0]
+            allparts.insert(0, parts[1])
+    return allparts
+
 def get_movie_name_from_folder(folder_path, with_year):
     """
     Get the name of the movie from the folder.
@@ -1117,7 +1132,7 @@ def get_movie_name_from_folder(folder_path, with_year):
     :return:
     """
     # Split the folder into a list of paths
-    folder_split = os.path.normpath(folder_path).split(os.sep)
+    folder_split = splitall(os.path.normpath(folder_path))

     if folder_split[-1] == 'VIDEO_TS':  # If the folder is from a DVD
         # Strip the VIDEO_TS folder

Instead of being unable to find the nfo file and begin the scraping process, it instead proceeds as expected:

2023-06-17 15:48:39,021 (7f05da27ab38) :  DEBUG (sandbox:19) - ++++++++++++++++++++++++
2023-06-17 15:48:39,022 (7f05da27ab38) :  DEBUG (sandbox:19) - Entering search function
2023-06-17 15:48:39,022 (7f05da27ab38) :  DEBUG (sandbox:19) - ++++++++++++++++++++++++
2023-06-17 15:48:39,023 (7f05da27ab38) :  INFO (__init__:118) - Gay Adult NFO Importer Version: 1.1-119-g5106699-225
2023-06-17 15:48:39,023 (7f05da27ab38) :  DEBUG (sandbox:19) - Plex Server Version: 1.32.3.7192-7aa441827
2023-06-17 15:48:39,024 (7f05da27ab38) :  INFO (__init__:123) - Agents debug logging is enabled!
2023-06-17 15:48:39,025 (7f05da27ab38) :  DEBUG (sandbox:19) - media file: /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)/(Alternadudes) - AlternaStuds (2014) Scene 1.mp4
2023-06-17 15:48:39,025 (7f05da27ab38) :  DEBUG (sandbox:19) - folder path: /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)
2023-06-17 15:48:39,026 (7f05da27ab38) :  DEBUG (sandbox:19) - Movie name from folder (with year): /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)/(Alternadudes) - AlternaStuds
2023-06-17 15:48:39,027 (7f05da27ab38) :  DEBUG (sandbox:19) - Movie name from folder: /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)/(Alternadudes) - AlternaStuds (2014)
2023-06-17 15:48:39,027 (7f05da27ab38) :  DEBUG (sandbox:19) - Trying /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)/nfo/(Alternadudes) - AlternaStuds (2014) Scene 1.nfo
2023-06-17 15:48:39,028 (7f05da27ab38) :  DEBUG (sandbox:19) - Trying /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)/NFO/(Alternadudes) - AlternaStuds (2014) Scene 1.nfo
2023-06-17 15:48:39,029 (7f05da27ab38) :  DEBUG (sandbox:19) - Trying /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)/(Alternadudes) - AlternaStuds (2014) Scene 1.nfo
2023-06-17 15:48:39,029 (7f05da27ab38) :  DEBUG (sandbox:19) - Trying /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)/(Alternadudes) - AlternaStuds.nfo
2023-06-17 15:48:39,030 (7f05da27ab38) :  DEBUG (sandbox:19) - Trying /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)/(Alternadudes) - AlternaStuds (2014).nfo
2023-06-17 15:48:39,030 (7f05da27ab38) :  INFO (__init__:1170) - Found .nfo file /volume1/pr0nz/Movies/(Alternadudes) - AlternaStuds (2014)/(Alternadudes) - AlternaStuds (2014).nfo

Note the /volume1/ vs volume1/ in several of those filenames.

Attached is the nfo file (but as a txt file since NFO isn't an allowed file type) (Alternadudes) - AlternaStuds (2014).txt

from pgma-modernized.

CodyBerenson avatar CodyBerenson commented on June 25, 2024

@minielim Sounds like you found a fix. Your NFO works perfectly for me with the as-in agent, but I'm going to admit I'm not a coder and it isn't clear to me what your use case and folder structure/file naming looks like given your mention of stacking. If you'd like to propose a pull request, we can get your fix for this agent incorporated into the repository once I've tested it a bit. And I've asked Jason to add to his considerable backlog dealing with the IAFD cloudflare stuff in this agent so the IAFD portions may again work. IAFD is messy across the board right now, and Jason is trying to figure out a solution that will work across all agents.

Long on my to-do list was to craft some documentation in our guide for folks on how to use the agent to index a film that doesn't appear on any sites, paired with a poster and a properly formatted .NFO. Question: what tool do you use to build your .NFO? I use a an old java scraper that doesn't scrape anymore but will build a .NFO...but I can see at least one additional field in your .NFO that isn't an option with the tool I use.

Finally, I'll test out IAFD stacking, thanks for mentioning. I believe it supports the same stacking cadence as the rest of the agents, but I'll take a look.

Cheers!

from pgma-modernized.

CodyBerenson avatar CodyBerenson commented on June 25, 2024

Just tested IAFD Stacking, worked fine on my system:

image

image
image

from pgma-modernized.

JPH71 avatar JPH71 commented on June 25, 2024

from pgma-modernized.

minielim avatar minielim commented on June 25, 2024

Why this issue doesn't show up on Windows

This issue is only going to appear on Linux and from your example you are on Windows.
On Windows the path Y:\test\AlternaStuds\<whatever> will be split into [ "Y:", "test", "AlternaStuds", ... ]. This list can easily be turned back into a valid path by putting a folder separator between the entries.

However, on Linux the path starts with the folder separator (instead of a drive letter). So, the path /volume1/pr0nz/Movies/AlternaStuds/<whatever> will be split into [ "volume1", "pr0nz", ... ] which no longer results in a valid path when joined back together with folder separators.

I will see about creating a pull request with my fix.

NFO file creation

From an experiment in the distant past with XBMC/Kodi, I have some NFO files generated by, I think, Ember Media Manager which gave me the general xml format. I then looked through the agent python to see what tags it was looking for and experimented a bit.

These days, I find the minimum information required and then open up a text editor and write the XML manually. So, not the most helpful to anyone else.

From the Ember Media Manager forum, it does look like someone is working on an adult scraper, but I have not tried it.

My library folder layout

    /volume1/pr0nz/Movies/ - library with the Gay Adult Films agent enabled
        (Studio) - Title (Year)/
            (Studio) - Title (Year).<video extension> - movie in a single file
            (Studio) - Title (Year)-<Extra_type>.<video extension> - behindthescenes, trailer, other, etc.  for extra videos related to this title
            OR
            (Studio) - Title (Year) Scene <N>.<video extension> - scene format from pdf documentation (images/PlexGayMetadataAgents-InstallationandUsageGuide.pdf page 30)

I had been following the pdf documentation which lists the Scene format as (Studio) - Title (Year) Scene <N>.<video extension> which ends up with the IAFD agent failing in a search for:

2023-06-18 13:45:09,447 (7f1fe56f0b38) :  INFO (sandbox:19) - IAFD  - SEARCH:: *********************************************** >> IAFD: Finished Search Routine << ***********************************************
2023-06-18 13:45:09,448 (7f1fe56f0b38) :  INFO (sandbox:19) - IAFD  - SEARCH:: ************************************** >> (Alternadudes) - AlternaStuds (2014) Scene 1 (0) << *************************************

Switching to your example format (Studio) - Title (Year) - Scene <N>.<video extension> does result in a much more promising:

2023-06-18 13:45:09,447 (7f1fe56f0b38) :  INFO (sandbox:19) - IAFD  - SEARCH:: *********************************************** >> IAFD: Finished Search Routine << ***********************************************
2023-06-18 13:49:02,365 (7f1fe56f0b38) :  INFO (sandbox:19) - IAFD  - SEARCH:: ******************************************** >> (Alternadudes) - AlternaStuds (2014) << *******************************************

However, the scraper gets a 403 and stops the search processing so I can't currently validate further.

It appears the IAFD scraper probably does support scenes and I just had the filename formatting wrong. Thanks for the working example.

from pgma-modernized.

JPH71 avatar JPH71 commented on June 25, 2024

from pgma-modernized.

JPH71 avatar JPH71 commented on June 25, 2024

from pgma-modernized.

minielim avatar minielim commented on June 25, 2024

Using the scene formatting from the pdf doc (Studio) - Title (Year) Scene <N>.<video extension> I got the error:
com.plexapp.agents.IAFD.log.docsFormat.txt

I did also test (Studio) - Title (Year)-Scene <N>.<video extension> and it also failed to build a correct search string in the exact same way.

Given the working example earlier in this thread, I have updated my formatting to (Studio) - Title (Year) - Scene <N>.<video extension> which now appears to do a valid search but is thwarted by the HTTP 403:
com.plexapp.agents.IAFD.log.exampleFormat.txt

from pgma-modernized.

CodyBerenson avatar CodyBerenson commented on June 25, 2024

@minielim I tested a bunch of .NFO titles, Pull request merged. Thanks for the contribution. I'm going to close this issue.

re: Adult .NFO scrapers, there are two options that I know of for Gay Porn Feature Films. TinyMediaManager allows one to use TMDB to find some titles, and MediaElch also uses TMDB but also AEBN, HotMovies, and DVDEmpire (although gay content is only scraped via AEBN).

from pgma-modernized.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.