• 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 Support General Questions Spanish IMDb: FilmAffinity - How to grab metadata (or part of it)

     
    • 0 Vote(s) - 0 Average

    Spanish IMDb: FilmAffinity - How to grab metadata (or part of it)

    harrenkyym
    Offline

    Junior Member

    Posts: 14
    Threads: 7
    Joined: 2024 Jan
    Reputation: 1
    Country:Spain
    #1
    2024-01-19, 04:16 PM
    Hi everyone. I don't know how to make this approach, so here I am.

    There is a spanish IMDb very popular (even more than IMDb) called FilmAffinity. I'm a heavy user of it. I rate movies in that website (and many friends too, we don't use IMDb), so you can guess how I love that site.

    Two problems:

    - There is no API for it (and I consulted them many time, not planned to do it)
    - Although it is a huge huge huge movies DB, it is not as HUUUUUUUGE as IMDb, and sometimes (it's rare, but it happens) I have files that aren't in the FilmAffinity DB.

    So, I was thinking:

    There is an unofficial FilmAffinity API that I could use (https://github.com/xsga/filmaffinity-api). But I don't want to get rid of IMDb (or TMDB) for the most part of metadata because they are much more complete.

    I'd love to call the unofficial FilmAffinity API for complementing what I already have. I'd like to grab the rating, genres, synopsis (I like FA ones) and the country (I don't know what can I do with it, but I need the possibility of filtering by country).

    How can I do it? Is that even possible? Could I even pass from deplyoing the API and just use a python script that grabs the info from the FA site? How could I patch just the metadata I want? Maybe I could tell the script "if all title, director and one of this actors matchs, then it is the same movie, then replace the data (i would use the year because in some rare cases I've seen differences of +/- 1 year) That makes me think: How the hell Jellyfin knows that one movie is this IMDb ID and that TMDB ID? Becasue FA also uses IDs, but I don't know how to recon those IDs.

    I've seen that everything is saved in library.db, how could I bulk edit it?

    Kind of lost here.
    tmsrxzar
    Offline

    Senior Member

    Posts: 755
    Threads: 6
    Joined: 2023 Nov
    Reputation: 20
    #2
    2024-01-19, 04:27 PM
    just a few notes to add

    if filmaffinity has no public api then any clients would be "web scrapers" masquerading as api clients; these tend to be unreliable as websites change
    if you want to create your own scraper that uses your linked code take a look at how existing scrapers are written; https://github.com/jellyfin/jellyfin-meta-plugins
    if you want to start manually doing this then the better method would be to create NFO files from filmaffinity and not editing the db; https://jellyfin.org/docs/general/server/metadata/nfo/

    i did take note your linked github has been archived and hasn't been changed in 2 years; this is likely to end badly since it's not an api as i noted above about scrapers
    harrenkyym
    Offline

    Junior Member

    Posts: 14
    Threads: 7
    Joined: 2024 Jan
    Reputation: 1
    Country:Spain
    #3
    2024-01-26, 03:31 PM
    Hey, @tmsrxzar.

    Thanks for your reply.

    I've been tinkering a little bit... I have a question. I've checked this doc page: https://jellyfin.org/docs/general/server/metadata/nfo/

    A few questions:

    - I'm quoting: "Provider id tags are supported as well if they follow the scheme: <PROVIDER_NAME+ id>." So, could I write <filmaffinityid>514584</filmaffinityid> for this link https://www.filmaffinity.com/es/film514584.html ? I mean, I don't know if it is useful in any way. I've tried to do it and I don't see anything other than maybe just having the code for doing something later with a python script and webscraping...

    - <userrating></userrating> Does it work? As I said, I use to rate in FilmAffinity every movie/show I watch. It would be cool if I could have it too in Jellyfin. I've tried <userrating>10</userrating> but as before, nothing changes. (Other than having the info stored somewhere in the server)

    - <country> Same question. Does it work? How should be the country written? English? Can I filter somehow by country?
    tmsrxzar
    Offline

    Senior Member

    Posts: 755
    Threads: 6
    Joined: 2023 Nov
    Reputation: 20
    #4
    2024-01-26, 04:25 PM
    1. "Provider id tags are supported as well if they follow the scheme: <PROVIDER_NAME+ id>."
    i'm not sure how this is used but i doubt it will be useful since jellyfin doesn't know filmaffinity
    personally i would put the filmaffinity id into the uniqueid tag, just for later reference and since the uniqueid will not match imdb/tmdb/omdb/etc

    2. userrating
    i don't see this tag in the documentation, closest is customrating which is actually a parental rating which is not what you want
    the closest thing i think this would relate to is "Community Rating"
    in order to get that rating it would be under "ratings", note the s on the end which is different from rating; see that tag here https://kodi.wiki/view/NFO_files/Movies
    this is another one i'm not sure how to format into the nfo; might need to have jellyfin export an nfo for something it has the tags for (from tmdb) so that you can copy it
    this is the number shown on an item for "Stars" next to the Tomatoes (tomatoes is critic rating)

    3. country
    this tag should show up in various places, checking the metadata on an item already in my library it shows up blank
    has a note under it "Leave empty to inherit settings from a parent item or the global default value."
    and i don't see any way to filter or search by this field so not sure it's even useful other than some detailed displays, not even shown on a movie page anywhere
    tmsrxzar
    Offline

    Senior Member

    Posts: 755
    Threads: 6
    Joined: 2023 Nov
    Reputation: 20
    #5
    2024-01-26, 04:45 PM (This post was last modified: 2024-01-26, 04:48 PM by tmsrxzar. Edited 3 times in total.)
    *edit

    i went ahead and exported an nfo from jellyfin to check things, the documentation is wrong about rating
    it states 'rating' is the same as 'customrating' but customrating is a parental rating

    this is not the case, the 'user' rating goes into the 'rating' tag so ignore 2. and instead of userrating use '<rating>'

    uniqueid isn't used either
    it's just 'id'

    or

    Code:
    <id>tt0133093</id>
    <imdbid>tt0133093</imdbid>
    <tmdbid>603</tmdbid>
    harrenkyym
    Offline

    Junior Member

    Posts: 14
    Threads: 7
    Joined: 2024 Jan
    Reputation: 1
    Country:Spain
    #6
    2024-02-13, 11:36 PM
    Hey, I've been working on my scripts, but I just realized one shitty thing. When I create an NFO file to overwrite some tags, example (file automatically created with my script):

    <?xml version='1.0' encoding='utf-8'?>
    <movie>
    <title>American Fiction</title>
    <year>2023</year>
    <plot>El profesor de inglés y escritor Thelonious 'Monk' Ellison escribe una novela satírica bajo seudónimo, con la intención de denunciar la hipocresía de la industria editorial.l</plot>
    <genre>Comedia</genre>
    <genre>Drama</genre>
    <tag>Comedia dramática</tag>
    <tag>Literatura</tag>
    <country>Estados Unidos</country>
    <rating>6,7</rating>
    <filmaffinityid>779260</filmaffinityid>
    </movie>

    I'm not declaring any part of the cast, or the crew... I don't need to change it. But when Jellyfin reads the NFO file, it deletes all cast & crew info (and I guess something else). So I end up with all the info from FilmAffinity, which is supercool, but without actors, director, writer... Slightly-frowning-face

    How can I avoid this behavior?
    tmsrxzar
    Offline

    Senior Member

    Posts: 755
    Threads: 6
    Joined: 2023 Nov
    Reputation: 20
    #7
    2024-02-13, 11:39 PM
    you cant avoid that behavior

    either jellyfin loads information from an nfo "or" from a scraper, there is no fallback for missing information
    you'll have to add the information to the nfo
    harrenkyym
    Offline

    Junior Member

    Posts: 14
    Threads: 7
    Joined: 2024 Jan
    Reputation: 1
    Country:Spain
    #8
    2024-02-13, 11:46 PM
    Truth be told, I was expecting that answer.

    So... best option to extract all the metadata I have into an nfo file (then with my script, change the tags I need)? Creating a script for it? Or can I do something in Jellyfin to create them WITHOUT rescanning (I have many things manually changed after scanning, so I don't want to rescan for create nfo's)?
    harrenkyym
    Offline

    Junior Member

    Posts: 14
    Threads: 7
    Joined: 2024 Jan
    Reputation: 1
    Country:Spain
    #9
    2024-02-15, 02:22 PM (This post was last modified: 2024-02-18, 02:51 PM by harrenkyym. Edited 2 times in total.)
    Those are the tags I've found (don't pay attention to the indentation, I've copy/pasted from many sources) after activating "create nfo" in Jellyfin:

    <title></title>
    <year></year>
    <plot></plot>
    <genre></genre>
    <tag></tag>
    <country></country>
    <rating></rating>
    <filmaffinityid></filmaffinityid> (invented by me, just for scrapping purposes)


    <lockdata></lockdata>
    <dateadded></dateadded>
    <originaltitle></originaltitle>
    <director></director>
    <writer></writer>
    <credits></credits>
    <trailer></trailer>
    <mpaa></mpaa>
    <collectionnumber></collectionnumber>
    <imdbid></imdbid>
    <tmdbid></tmdbid>
    <premiered></premiered>
    <releasedate></releasedate>
    <criticrating></criticrating>
    <runtime></runtime>
    <tagline></tagline>
    <studio></studio>
    <art>
      <poster></poster>
      <fanart></fanart>
    </art>
      <actor>
        <name></name>
        <role></role>
        <type></type>
        <sortorder></sortorder>
        <thumb></thumb>
      </actor>
      <id></id>
      <set></set>
      <fileinfo>
        <streamdetails>
          <video>
            <codec></codec>
            <micodec></micodec>
            <bitrate></bitrate>
            <width></width>
            <height></height>
            <aspect></aspect>
            <aspectratio></aspectratio>
            <framerate></framerate>
            <language></language>
            <scantype></scantype>
            <default></default>
            <forced></forced>
            <duration></duration>
            <durationinseconds></durationinseconds>
          </video>
          <audio>
            <codec></codec>
            <micodec></micodec>
            <bitrate></bitrate>
            <language></language>
            <scantype></scantype>
            <channels></channels>
            <samplingrate></samplingrate>
            <default></default>
            <forced></forced>
          </audio>
          <subtitle>
            <codec></codec>
            <micodec></micodec>
            <language></language>
            <scantype></scantype>
            <default></default>
            <forced></forced>
          </subtitle>
        </streamdetails>
      </fileinfo>


    Two questions:

    - Do I have to set on my nfo all the information inside <fileinfo></fileinfo>? Or I can pass (so I don't fuck anything).
    - Are there any other tags that I'm missing? I've checked like 10 nfo's from different files with different content (being part of a collection, having this or that codec, being a known movie with a lot of info, being a very unknown movie...)

    @tmsrxzar?
    « 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