• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Development Client Development Help Needed: Extracting Size and Resolution of Movies from Jellyfin API

     
    • 0 Vote(s) - 0 Average

    Help Needed: Extracting Size and Resolution of Movies from Jellyfin API

    BoBBer446
    Offline

    Junior Member

    Posts: 12
    Threads: 5
    Joined: 2024 Jan
    Reputation: 0
    #1
    2024-04-01, 12:53 PM
    Hello everyone,

    I've been working on a Python script to find and manage duplicate movies in my Jellyfin media server. The script's goal is to identify duplicates based on movie names, then sort them by size and resolution to help decide which duplicates to keep or delete. However, I've hit a snag with extracting accurate size and resolution data for each movie.

    Here's what I've attempted:

    1. Fetching All Media Items: I used the /Items?IncludeItemTypes=Movie&Recursive=true endpoint to get a list of all movies. This part works fine, and I can retrieve basic information about each movie.

    2. Extracting Size and Resolution: To get detailed information about each movie, including its size and resolution, I tried using the /Items/{itemId}/PlaybackInfo endpoint, expecting it to return the necessary data. Here's a simplified version of my approach:

    python
    def get_media_playback_info(self, item_id):
        url = f"{self.base_url}/Items/{item_id}/PlaybackInfo"
        response = requests.get(url, headers=self.headers)
        return response.json()


    From this, I aimed to extract the Size and Resolution for sorting purposes. Unfortunately, the API response does not seem to include the data in the format or location I expected. Instead of receiving actual size and resolution values, I'm getting zeros or placeholder texts like "Unbekannter Pfad" for the path, which means "Unknown path" in German.

    3. Attempts at Solutions: I've thoroughly checked the API documentation and tried different endpoints that might offer the needed details, such as /Environment/NetworkShares and /Items/{itemId}/PlaybackInfo, but to no avail. My attempts either result in incomplete data or do not directly address my needs for size and resolution.

    I'm reaching out for help in this forum because I believe there might be something I'm overlooking or misinterpreting in the Jellyfin API responses. Has anyone successfully extracted movie file sizes and resolutions using the Jellyfin API? If so, could you share how you achieved it? Examples or snippets of your approach would be immensely helpful.

    Additionally, if there are alternative methods or endpoints I should consider, please let me know. My primary goal is to accurately identify duplicates by comparing their file size and resolution, making the management of my media library more efficient.

    Thank you in advance for any assistance or insights you can provide!
    BoBBer446
    Offline

    Junior Member

    Posts: 12
    Threads: 5
    Joined: 2024 Jan
    Reputation: 0
    #2
    2024-04-01, 03:49 PM
    Ich habe es rausgefunden.

    Wer Interesse hat darf es gerne Verwenden, kopieren und verbessern:
    https://github.com/BoBBer446/jellyfin_du...es_finder/
    mcarlton00
    Offline

    Kodi Addon Maintainer

    Posts: 145
    Threads: 1
    Joined: 2023 Sep
    Reputation: 9
    Country:United States
    #3
    2024-04-01, 07:45 PM
    Easiest way is likely going to be to add &fields=Height,Width to your /Items request
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode