Jellyfin Forum
Plugins that add a 'code' field and insert its value into strm links. - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Development (https://forum.jellyfin.org/f-development)
+--- Forum: Plugin Development (https://forum.jellyfin.org/f-plugin-development)
+--- Thread: Plugins that add a 'code' field and insert its value into strm links. (/t-plugins-that-add-a-code-field-and-insert-its-value-into-strm-links--4012)



Plugins that add a 'code' field and insert its value into strm links. - Maxy TV - 2024-01-21

Hello Jellyfin community!

I'm working on a personal project and I need a very specific plugin. I'm looking for a plugin that adds a 'code' field to be entered by a human, either through the admin control panel or via registration through an invitation link with jfa-go.

Let's imagine that Peter enters his code, which is: 2578.

Well, the thing is—I'm adding libraries to my server with strm files.

Imagine the link for any movie, for example:
http://movies.com/video/code/madagascar_2/
This is the link that would be in the strm file.

So, I would like that when Peter hits Play on the Madagascar 2 movie, the plugin takes his code (2578) and inserts it into the space marked 'code', like this:
http://movies.com/video/2578/madagascar_2/

I don't want it to change the link in the server's strm file with Peter's code; I want the video to be played from the client with Peter's link and code.

I'm having trouble finding any Jellyfin/Emby plugin developers on the internet, and I'm not sure if I'm in the right place to find one.

If anyone can help me or tell me where I can hire a developer, it would be appreciated.

Thank you very much.


RE: Plugins that add a 'code' field and insert its value into strm links. - crobibero - 2024-01-22

What you are asking for isn’t possible with how Jellyfin works.


RE: Plugins that add a 'code' field and insert its value into strm links. - Maxy TV - 2024-01-22

Let's break it down; I'll try to approach it differently and outline a workflow. I would appreciate it if you could confirm point by point whether each of them is possible or not, allowing me to assess options and possibilities with the resources I have.

0.1: The plugin is capable of creating a 'code' field to be filled in during user registration. I think this is not impossible since I have seen plugins that add checkboxes to Jellyfin. Similar to how values like True or False are stored in the database attribute for checking or unchecking the box, an alphanumeric value could also be entered into an attribute in the database table.

1. Within the plugin functions, there is a call to "PlayBackStart," which supposedly registers when a user hits play on a file.

2. The plugin can be designed to communicate with the external; specifically, it could notify an external process that user X has started playing a specific movie. Is that possible? Alternatively, upon receiving the user's click, it could execute a pre-existing script in the operating system to handle part of the work.

3. After receiving the user's playback notification, a program will be monitoring when this happens to call the script (if the plugin is unable to call the script after the play event occurs). This script will take care of retrieving the user's ID stored in the jellyfin.db database. I assume the notification will indicate which user performed the play action, allowing the script to find the code stored in that user's database.

4. Once we have identified the file and the code, the OS script could replace the content of .strm by modifying (and saving) the place where 'code' is located with the code obtained from the user. It would revert the changes within a few seconds, only needing the time it takes for the client to grab its link.

Now, Jellyfin should be able to play the .strm with the user's link. But of course, how do we ensure that Jellyfin takes the link with the modified code? Will Jellyfin take the unmodified link before the script can modify it?

5. For this to be possible, we would need to make Jellyfin wait 1 or 2 seconds to take the link from the strm file to ensure that the script has enough time to make the modification. If delaying the connection is not possible, another approach could be to provoke a retry of the connection after 1 or 2 seconds.

Thank you very much for all your help. If I achieve what I'm aiming for, it will be a very interesting project as it plans to integrate with Telegram's unlimited storage. This would result in almost negligible storage costs, with only the costs of hosting and running the Telegram bot (if the bot is implemented in the cloud) being necessary.


RE: Plugins that add a 'code' field and insert its value into strm links. - niels - 2024-01-22

0.1: no, plugins can only provide configuration pages in the dashboard
1: yes, there are events that a plugin can listen to
2: yes, plugins are written with .NET which allows starting processes
3: no, you cannot read the jellyfin database file when it is in use by the server
4. no, the strm file is already read before the play event is emitted

What you're trying to do is impossible and would require changes to the server (and clients) that we wouldn't accept. Additionally your idea of using Telegram as free file storage is most likely against their TOS.


RE: Plugins that add a 'code' field and insert its value into strm links. - Maxy TV - 2024-01-22

Thank you for your clarifications.

In light of the possibilities you mentioned, which you said were feasible, I'm going to try exploring those options.

Furthermore, allow me to tell you that yes, I understand it seems like a tough challenge. However, I have a lot of faith in this project and would like to continue attempting it.

Regarding Telegram's Terms of Service, there is no impediment to using it as an unlimited cloud. In fact, many media outlets promote its use as an unlimited cloud, and we can even find applications like TeleDrive in the Microsoft Store.

Thank you very much for the information.


RE: Plugins that add a 'code' field and insert its value into strm links. - tmsrxzar - 2024-01-22

have jellyfin serve files hosted on file sharing sites?
sounds like every kodi pirate addon ever to me