Help on creating new Agent (docs, advise) etc. Already searched but not found much.

Hi, All

nb: the only way I am affiliated with the Laracasts site (below) is being an active subscriber.

I am wanting to create a new Agent for the downloaded series I have from laracasts.com. These PHP video tutorials are in series format. For instance, take the free series Laravel 5 fundamentals, it has many episodes and this is just one of many series’.

I have been researching this on and off for days but I’m only able to find snippets of information.
I managed to download a .pdf file on my phone but I can’t recall where I got it from (shared on my Gdrive).
The format of this I can believe as it is similar to code I have on my computer.

However, I am aware of recent changes to Plex (server) and I am not sure whether it affects this.

##Github Account full of Agents
I have found the account github.com/plexinc-agents and I have forked the LocalMedia.bundle Agent as I am hoping this Agent will give me my best chance of successfully reaching my goal.

##What is my goal?
Well, I want to be able to:

  • Download the episodes using the laracastsDownloader and/or further down the line create a similar tool that will incorporate the below steps.
  • Scrape the metadata I need from the page eg Episode 1
{
  "Series": "Laravel 5 Fundamentals",
  "EpisodeNumber": "01",
  "Title": "Meet Composer",
  "Title Sort": "Laravel 5 Fundamentals - 01"
}
  • I want to then either convert this into data that the Plex server can work with either by writing the correct metadata to the media files using the command line in Linux (but then that puts a scuppa on anybody else wanting to use the facility on Windows etc) or use a custom Agent to provide my “Laracasts” Library with the proper data. I have also seen numerous threads on the forum where people have unsuccessfully tried to force the Plex server and more specifically local files to use the information they want them to have via meta tags and the numerous problems they have more than not with failed results.

I have visited many pages on this forum and quite a bit of the time when I try to research something I end up with docs from 201x-2015 and I worry that these will just lead me down a dead end coding wise as others have referred to them on the forum as no longer working properly.

##Questions (in no particular order I’m afraid)

  1. Am I on the right track here?
  2. Am I right in assuming the if I choose to go the Agent route the correct python version is 2.x and not 3.x? My knowledge and experience of Python is rusty but I will be able to get by if needed
  3. Is the document I linked to still valid?
  4. Are there any more documents that I would find useful?
  5. Do you have any more advice?

###More questions added 2017-10-05 22:19 GMT

  1. Where do I place the new Agent if I go that route?
  2. Is it possible to create a new type of media with a new Agent ( so instead of forcing the Laracasts metadata into the default (TV Shows) fields) - for example instead of opening the edit box and seeing a “Rating” field would it be possible to have a [difficulty] “Level” field shown instead. I have seen a few Agents in the aforementioned Github account where they add fields to where the ‘Music Video’ filed is within the default edit screen"?

Thanks in advance and I hope you are able to help.
John

Just a few links:


Best advice I can give is to study other scanners/agents for how they work.

Thanks, @zo1d
I haven’t looked at the links yet as I only refreshed the page on the off chance of a reply :-/
I will take a look in a bit though.
I actually got quite far last night by

  1. Searching for existing .bundle directories to find where the plugins where/are kept
  2. Copying the PersonalMedia.bundle directory to Laracasts.bundle
  3. Altering the code to match more with my requirements

I now have my Laracasts library using my Laracasts.bundle agent. I was working on the tagging last night until around 04:00 but then I had to leave it there. I will hopefully be returning to it later in a few hours.

Thanks again for the links, which I look forward to looking at shortly

Hiya, i would recommend using tv series libraries to handle that, although everything is going to be season 1 so forego displaing seasons when creating the “TV Series” library

You may want to start with search to assign a unique id on each series.
You could actually do you own xml database with series information instead of querying the web page so that your agent doesn’t stop working if the html code parsed changed…
You may want to put the code on github so people can assist
Look at HAMA source code https://github.com/ZeroQI/Hama.bundle that could help

https://github.com/ZeroQI/Hama.bundle/releases/download/v1.0/Empty_Agent_template.bundle.7z for an empty agent template to get you started