Hey folks, there is a new Podcast category for forums https://forums.plex.tv/categories/podcasts
If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Paid job: Need a plugin

First of all, I checked the guidelines regarding whether it is allowed or not to post something like this. I did not find that it wouldn't be allowed. Also; I am rather new to Plex and its terminology (not sure if "plugin" is the right word for example).

Since I am no coder, and I am asking someone to do the job for me, it's reasonable that I need to pay for the job.


Background
I have a folder structure that contains movies compressed into split-volume RAR files. Let's call them RAR-folders.
There need to be an scraping process that indexes the RAR folders We need to assign a depth value, since some folders contain sub-folders with split-volume RARs directly underneath, while others lie one more step deeper.
As for the scraping, the more data we can gain, the better. A minimum is: Title, Thumbnail. Bonus would be IMDB rating.
The folders containing the RAR files could be e.g. Movies, TV Shows, Cartoon.
Under the plugin setting, an admin can assign RAR folders to existing media libraries. This can be done either by assigning a media library to a folder structure, or the other way around. You decide.
As we know, a media library has a folder assigned to it (or actually it supports multiple, but we'll only support one). Lets call it the target folder.

When the setup is done, a user can then see the plugin icon.
Entering the plugin brings you to a list of the libraries.
Entering either of the libraries brings up a list scraped from the RAR folders.
Each folder has a checkbox (since its a list-view, each row equals a checkbox).
Checking the checkbox triggers an unpack to the target folder (the folder that is assigned to the current media library).
1) A progress bar is needed
2) A popup asks if you want to proceed to unpack (this is important in web-view on a mobile phone).
Unchecking the checkbox deletes the file from the target folder.
1) A popup asks if you want to proceed.

Plugin requirement
* Unpacking RAR files + progress bar indicator.
* File deletion.
* Access to the Plex media database: To read their library names, and the folder assigned to each of the libraries.
* Scraping mechanism that scans folders by their names and creates a list with Movie Name, Thumbnail and preferably IMDB rating..

Look and feel / Inspiration
* http://plexrequests.8bits.ca/screenshots/.

Answers

  • ZeroQIZeroQI Posts: 1,427Members ✭✭✭

    A Series "scanner" does present the file to plex with a serie name, and choose the season, episode number, can present an episode title, which should be overwritten by the agent. Plex series scanner does not populate the episode title but my Absolute Series scanner does, for example

    An "agent" assign a unique id to a serie name (search() function) and (Update() function) gather metadata from a metadata source, in general TheTVDB.com for series libraries or TheMovieDB for movie libraries (although TMDB does support series now).

    Channel are a bit separate and can do a bit like youtube.
    Both channels and Agents go in "plug-ins" folder

    i can code a scanner easily that shows in plex your library and normal agent can show the metadata but the video files are not view-able under Plex then until decompressed and this will therefore be working but a separate tool needs to be there to handle the decompression and deletion...

    You need a Channel custom to manage that (like the https://github.com/lokenx/plexrequests-meteor) you referenced
    I cannot fathom the reason for having already compressed files re-compressed, so the only readon is the rar volume file...

    Absolute Series Scanner (ASS): Seasons+Absolute mode series scanner managing subdirectories and AniDB type specials,with a logging off all files (skipped on top of root folder, then sorted one line per file with regex used and info, all series sorted alphabetically) and one with the filelist to reproduce the library on my end with dummy files. It also add all files and recognise specials pretty accurately.

    http AniDB Metadata Agent (HAMA): Some good info there, will have to re-write it at some point... Data folders are kinda mandatory... Huge libraries can fetch 10gb in space. If you have no poster but other metadata is showing, create "Plug-in Support/Data/com.plexapp.agents.hama/DataItems" agent folders as indicated in the readme on GitHub

    Impressed by the agent recognition rate? Consider donating few euros through Paypal: Absolute Series Scanner + HTTP AniDB Metadata Agent. (Donators: xnaas, Sven-7, Niegen, Vorador, Fratal, T. Mayville,  A. Estremera, KJKingJ, Blindsay, ...lacking space)

  • logicallyinsanelogicallyinsane Posts: 27Members, Plex Pass Plex Pass

    I sort of solved this issue with a cron script that runs hourly, looking for .rar files in a directory, when it finds them, it extracts them, deletes the archive files and sample files upon successful extraction, if everything else succeeds, it moves the directory automatically and sets permissions.

    Plex monitors my folders for changes and will automatically pick up the addition.

  • Haider of SwedenHaider of Sweden Posts: 18Members ✭✭

    logicallyinsane:
    I have an unpack software that monitors folders and unpacks automatically anything you put in there.
    That's not what I need though.
    First of all, there is no need to unpack everything. Second, there wouldn't be any space in the target directory anyway.

    ZeroQI:
    A little clarification: there is only need to unpack to a destination and delete from that destination. No need to repack.
    It sounds promising that you can code the scanner.
    Could you please provide some screenshots? You could send it as PM.
    What about the decompression and the progress indicator (the indicator might be a bonus, but I assume it can help the user to see if something gets stuck or so)? Is that something you could so as well?

  • ZeroQIZeroQI Posts: 1,427Members ✭✭✭

    The scanner make it a normal plex library so looking the same as a standard library...
    You would still be needing another software/web interface for decompression and popups...
    Possibly better to do a full 3rd party app but i can't do that...

    I can't find a logical use case for the way you have your files stored...
    don't get why compressing movies....

    Absolute Series Scanner (ASS): Seasons+Absolute mode series scanner managing subdirectories and AniDB type specials,with a logging off all files (skipped on top of root folder, then sorted one line per file with regex used and info, all series sorted alphabetically) and one with the filelist to reproduce the library on my end with dummy files. It also add all files and recognise specials pretty accurately.

    http AniDB Metadata Agent (HAMA): Some good info there, will have to re-write it at some point... Data folders are kinda mandatory... Huge libraries can fetch 10gb in space. If you have no poster but other metadata is showing, create "Plug-in Support/Data/com.plexapp.agents.hama/DataItems" agent folders as indicated in the readme on GitHub

    Impressed by the agent recognition rate? Consider donating few euros through Paypal: Absolute Series Scanner + HTTP AniDB Metadata Agent. (Donators: xnaas, Sven-7, Niegen, Vorador, Fratal, T. Mayville,  A. Estremera, KJKingJ, Blindsay, ...lacking space)

  • Haider  UppsamlingHaider Uppsamling Posts: 1Members

    Thank you ZeroQI

    Does your scanner work separately, ie in an own user interface, or is it meant to work with the regular library?
    In other words, on the left hand side, I do have libraries. Will I have yet another menu-item specifically for your scanner? Or will I still see the same library items, but they are scanned with a different scanner instead?

    Regarding the logical use case - thank you for pointing out those questions, but there is really no need to.
    There is a specific case which I need to solve and nothing is going to change it, unfortunately.
    There is no % saving what I know about, MD5 is not relevant, and VLC is irrelevant too because we are talking Plex here, aren't we?

    The case requires the files to be transfered in this fashion and I am looking for a coder that can help me to create a plugin/channel/app (whichever the proper term is).

    If you can do part of the job, and it looks good, then I might get good use of your software. Then I find another coder who can finish the work. This is totally normal that multiple persons work on a project.

  • Haider of SwedenHaider of Sweden Posts: 18Members ✭✭

    ps. I posted with my secondary account, I reported the post to get it erased, so I keep this instead.

    Thank you ZeroQI
    Does your scanner work separately, ie in an own user interface, or is it meant to work with the regular library?
    In other words, on the left hand side, I do have libraries. Will I have yet another menu-item specifically for your scanner? Or will I still see the same library items, but they are scanned with a different scanner instead?
    Regarding the logical use case - thank you for pointing out those questions, but there is really no need to.
    There is a specific case which I need to solve and nothing is going to change it, unfortunately.
    There is no % saving what I know about, MD5 is not relevant, and VLC is irrelevant too because we are talking Plex here, aren't we?
    The case requires the files to be transfered in this fashion and I am looking for a coder that can help me to create a plugin/channel/app (whichever the proper term is).
    If you can do part of the job, and it looks good, then I might get good use of your software. Then I find another coder who can finish the work. This is totally normal that multiple persons work on a project.

  • ZeroQIZeroQI Posts: 1,427Members ✭✭✭
    edited January 2017

    My scanner is a usual plex scanner, it does provide the serie name, episode and season number, to plex, adds proper logging though and plex will show files as it would a normal library on the left of the interface, it will not look any different, that is super easy, and the normal agent manage the metadata (reducing complexity).

    Difficult is to make it work really playing files... The trick here is to add the files path as if they were decompressed so when decompressed, it look like a normal Plex library for all intents and purposes, but the files will show missing (which indicate they are not decompressed, possibly a good thing there).

    The agent would have to download for tv series the screenshot for thetvdb since it would be able to analyse the file in the rar for a preview.

    It would need one scanner for movies, one for tv series. Since i already have a good scanner for TV series, i can adapt it for that with minimal work for me

    If you were to decompress manually in the same folder the rars beforehand, then it would work.
    We need to have one folder in the library root folder (the one added to the library) for Series, with the files inside, possibly a season folder in any, so if the rar include another folder, this folder depth will need to be skipped when decompressing

    Could you create template files with zero size files inside so i can test the scanner ?
    If not i need the exact folders inside the rar to try and create test files

    Absolute Series Scanner (ASS): Seasons+Absolute mode series scanner managing subdirectories and AniDB type specials,with a logging off all files (skipped on top of root folder, then sorted one line per file with regex used and info, all series sorted alphabetically) and one with the filelist to reproduce the library on my end with dummy files. It also add all files and recognise specials pretty accurately.

    http AniDB Metadata Agent (HAMA): Some good info there, will have to re-write it at some point... Data folders are kinda mandatory... Huge libraries can fetch 10gb in space. If you have no poster but other metadata is showing, create "Plug-in Support/Data/com.plexapp.agents.hama/DataItems" agent folders as indicated in the readme on GitHub

    Impressed by the agent recognition rate? Consider donating few euros through Paypal: Absolute Series Scanner + HTTP AniDB Metadata Agent. (Donators: xnaas, Sven-7, Niegen, Vorador, Fratal, T. Mayville,  A. Estremera, KJKingJ, Blindsay, ...lacking space)

  • Haider of SwedenHaider of Sweden Posts: 18Members ✭✭

    There is no folder inside the RAR, but only one single video file.

    Something like this

    Location A
    Movies

    • Movie1
      -- Movie1.rar
      --- Movie1.mkv
    • Movie2
      -- Movie2.rar
      --- Movie2.mkv

    And so on.

    My idea was then to decompress to Location B which is totally different.
    Plex scans Location B like any other location because it looks like this:

    Location B
    Movies

    • Movie1
      -- Movie1.mkv
    • Movie2
      -- Movie2.mkv

    And so on.

    Also, I needed the plugin to delete stuff from Location B, NOT EVER Location A.

    Hope things got more clear now.

    Last; I need to think about it, but maybe we can skip Location B.
    That would mean the plugin needs:

    • a scanner that can scan "empty folders", ie that appear empty because the file inside is stored in a RAR file.
    • uncompress mechanism (of the rar)
    • delete (of the recently uncompressed video file)
  • ZeroQIZeroQI Posts: 1,427Members ✭✭✭

    2 possibilities

    • you scan the decompressed folder only, no custom agent or scanner needed, just a web plugin to decompress, simpler BUT no info on compressed only movies/series
    • scanner to show compressed movies+series and add path were movies will be decompressed and web app to decompress/delete, from same folder or separate location, same folder is easier. at the very least, will show you meta for compressed movies. There need to be a custom scanner for movies and a separate one for series.

    Library 'root' folders:

    • /.../Movies
      • Movie 1
        • movie 1 (year).rar/r01/r02.../r50 inside rar: movie 1 (year).ext
      • Action
        • Movie 2
          • movie 2 (year).rar/r01/r02.../r50 inside rar: movie 2 (year).ex
    • /.../Series
      • Serie.rar/r01/r02.../r50 inside serie sxxexx.ext

    I already have a scanner for series so provide me with a precise example of a rar compressed serie path to the rar and folder structure inside it and i can code few lines to enable my current scanner to see series inside rar files. Plex will show the meta but will not be able to play the file. The code will be part of my standard scanner therefore updated when needs be but also open source so everybody benefits.

    If that please you, we can discuss the movie scanner and remuneration since i would not do a movie scanner otherwise but the technical bits would already be in the series scanner so easy at that point...

    You could also manually decompress and delete in the meantime to check functionalities.
    That seem like the best path to resolution.

    Absolute Series Scanner (ASS): Seasons+Absolute mode series scanner managing subdirectories and AniDB type specials,with a logging off all files (skipped on top of root folder, then sorted one line per file with regex used and info, all series sorted alphabetically) and one with the filelist to reproduce the library on my end with dummy files. It also add all files and recognise specials pretty accurately.

    http AniDB Metadata Agent (HAMA): Some good info there, will have to re-write it at some point... Data folders are kinda mandatory... Huge libraries can fetch 10gb in space. If you have no poster but other metadata is showing, create "Plug-in Support/Data/com.plexapp.agents.hama/DataItems" agent folders as indicated in the readme on GitHub

    Impressed by the agent recognition rate? Consider donating few euros through Paypal: Absolute Series Scanner + HTTP AniDB Metadata Agent. (Donators: xnaas, Sven-7, Niegen, Vorador, Fratal, T. Mayville,  A. Estremera, KJKingJ, Blindsay, ...lacking space)

  • Haider of SwedenHaider of Sweden Posts: 18Members ✭✭

    There are two possible cases for tv shows

    Case A

    • Show A
    • Show.a.s01.e01.rar
      -- Show.a.s01.e01.ext
      etc

    Case B

    • Show A
    • Season (ie subfolder)
      -- Show.a.s01.e01.rar
      --- Show.a.s01.e01.ext

    I am not sure about the decompression and the erasing of the decompressed file - did you say you are able to solve it?
    If it is an issue to decompress to another folder than its host folder, then we could start with the easy way first, by decompressing to the same folder.

  • Haider of SwedenHaider of Sweden Posts: 18Members ✭✭

    Anyone else who is interested to give this project a shot?
    I created this image to clarify a little more. Don't hesitate to ask if anything is unclear:

    This project would need some sort of scanner of Location A, plus that checkbox feature.

    • Scanning location A with the regular Plex Scanner would end up showing nothing. ZeroQI proposed a solution that would scan items even though the folder appears to be empty. For my particular need, this is perfect.
    • Checking the checkbox next to a movie would mean two things: 1) triggering the decompression from location A to location B and 2) an indication that this movie is decompressed. Unchecking means deleting the movie file from Location B.

    All the above, is the plugin.

    When it comes to Plex, it reads the Location B as a usual library. If there is anything in it, it can be played. If nothing is there, it appears empty.

  • NightNight Posts: 521Members, Plex Pass Plex Pass

    Why not use rar2fs?

    Primary PMS: Ubuntu 16.10, 4.4. running on Intel i7 990x 3.7Ghz, 32GB ram passmark 9525. 
    Media Storage: Plex: Samsung 850Evo 500GB SSD, Media: shhh it's a secret 

    Network: 1000/1000mbit + IPv6
    Desktop Clients: 2x Windows, 1x Chromecast Ultra, 1x PS4

    Mobile Clients:  1x Samsung Galaxy S7 Edge 

    Remote Users: 8

  • Haider of SwedenHaider of Sweden Posts: 18Members ✭✭

    @Night said:
    Why not use rar2fs?

    Thanks for the tip; unfortunately this works only for linux, hence a need for a plugin that works in Windows environment.
    At some point, I might install Plex on a NAS and maybe rar2fs won't work there either..

    ZeroQI: I sent you a PM :)

  • hasse69hasse69 Posts: 80Members, Plex Pass Plex Pass

    Just for info. There is now a port of rar2fs to work with WinFSP or Dokany.

  • Haider of SwedenHaider of Sweden Posts: 18Members ✭✭

    @hasse69 thank you for informing about this. Where can this rar2fs be found? I found this page https://hasse69.github.io/rar2fs/ (yours I assume) but no build for Windows that I can use with WinFSP or Dokany.

  • NightNight Posts: 521Members, Plex Pass Plex Pass

    Primary PMS: Ubuntu 16.10, 4.4. running on Intel i7 990x 3.7Ghz, 32GB ram passmark 9525. 
    Media Storage: Plex: Samsung 850Evo 500GB SSD, Media: shhh it's a secret 

    Network: 1000/1000mbit + IPv6
    Desktop Clients: 2x Windows, 1x Chromecast Ultra, 1x PS4

    Mobile Clients:  1x Samsung Galaxy S7 Edge 

    Remote Users: 8

  • ZeroQIZeroQI Posts: 1,427Members ✭✭✭

    https://gist.github.com/ZeroQI/974f6335ad4f31ecdfe1e4af0404098d
    I have added zip support which is included in Python while rar is not
    https://github.com/coryo/ComicReader.bundle use rar files

    if rarfile library can be loaded from plex should be easy with code below. Will test

          #RAR
          #import rarfile  #https://rarfile.readthedocs.io/en/latest/api.html
          #rar_archive = rarfile.RarFile('myarchive.rar')
          #for rar_archive_filename in rar_archive.infolist():
          #  zname, zext = os.path.splitext(rar_archive_filename.filename); zext = zext[1:]
          #  if zext in VIDEO_EXTS:  files.append(rar_archive_filename.filenamee)  #filecontents = rar_archive.read(rar_archive_filename)
    

    Absolute Series Scanner (ASS): Seasons+Absolute mode series scanner managing subdirectories and AniDB type specials,with a logging off all files (skipped on top of root folder, then sorted one line per file with regex used and info, all series sorted alphabetically) and one with the filelist to reproduce the library on my end with dummy files. It also add all files and recognise specials pretty accurately.

    http AniDB Metadata Agent (HAMA): Some good info there, will have to re-write it at some point... Data folders are kinda mandatory... Huge libraries can fetch 10gb in space. If you have no poster but other metadata is showing, create "Plug-in Support/Data/com.plexapp.agents.hama/DataItems" agent folders as indicated in the readme on GitHub

    Impressed by the agent recognition rate? Consider donating few euros through Paypal: Absolute Series Scanner + HTTP AniDB Metadata Agent. (Donators: xnaas, Sven-7, Niegen, Vorador, Fratal, T. Mayville,  A. Estremera, KJKingJ, Blindsay, ...lacking space)

Sign In or Register to comment.