Apple TV / iTunes movie library strmlnk creator

Infuse supporting strmlnk files has been a much loved feature for me. The strmlnk’s are not difficult to create but can be time consuming if you have a large library to backfill. To speed up the process, I made a website that creates strmlnk’s for Apple TV / iTunes movies.

I’m currently doing limited alpha testing. The alpha has 2 options for creating a strmlnk:

  1. Search for individual movies and download a strmlnk per movie
  • go to https://www.backfil.com
  • search for a movie
  • download a strmlnk using the “strmlnk” link at the bottom of the movie details page
  1. Bulk import your Apple TV movie library and download all strmlnk files together
  • go to Backfil / Alpha (Import Library)
  • use the alpha invite code APOLLO95 (no account necessary)
  • follow the instructions to import by copying/pasting your movie library metadata
  • download a ZIP file containing strmlnk files for all the movies in your library

The strmlnk’s that are created are compatible with TMDB naming guidelines so they will be recognized and matched within Infuse. When you click the “Open” button in Infuse, the strmlnk file will launch the Apple TV app and open directly to the movie page.

I’m looking for feedback around missing movies or problems importing.

Alpha (now)

  • Search for individual movies and download a strmlnk per movie
  • Bulk import your Apple TV movie library and download all strmlnk files together

Once I get a better sense of how well the alpha works for people then I will open up beta testing.

Beta (soon)

  • Account with sign-in
  • Saved library
  • Private WebDAV share of your library for direct Infuse integration
  • Add movies to your saved library individually and/or bulk import

Future

  • TV Show seasons and episodes
  • Additional country and language support
5 Likes

I’ve spent a fair bit of time attempting to automate this in as lazy a way as possible with little commitment, and got most of the way there with ChatGPT Pro models scouring the iTunes Web store and provide a zip with strmlnk files inside, but ultimately had to spot-check every file produced, as about 15-20% of them from each pass couldn’t find the accurate version based on the store’s country and simply did a search and replace on the country code (and confidently hallucinated), which rarely works as each title generally has their own unique ID per store.

Additionally, because of the amount of time the model had to think and the need to go out and retrieve URLs, it would constantly give me sass about providing it too many titles at once, so the work had to be broken into chunks of about 20 titles each run.

I got to letter E in my Apple TV library before taking a break and haven’t gone back.

Here’s a familiar link to Encanto (2021):

  • https://tv.apple.com/ca/movie/encanto/umc.cmc.3uji6fbqdcps9k4oxy1ikddrs

Based on this experience, your solution would have to do two things well:

  • Understand how to retrieve the correct regional/country store ID for a given title.
  • Be able to really handle bulk, like several hundred or thousand titles. I’m not sure if your solution is retrieving these results each time live from the Web, but that will take up a lot of server resources.

I’ve seen others post solutions that required so much technical know-how and setup, so making this dead simple will be a big win if you pull it off.

I just went through the invite and bulk uploaded about 429 titles, and about 12 had multiple matches, 12 couldn’t be found, and then there’s a peppering of titles that weren’t matched properly, BUT so far in spot checking (the watch link is very handy for this), the results are pretty solid.

This is really good stuff.

I’ll have to download the files and see if they still work from there and still open correctly in TV.app, but I think for your first exposure to public usage you did a good job! Once you get through your list of critical TODOs, tightening up the UI a bit could really make this premium.

A funny example of a mismatch is this version of Aladdin:

Edit:

I just ran it again, matching exactly the list view columns and I think it got slightly better results, but in doing so it doubled up the results page, so now there are over 800 titles and they’re all mostly dupes. There’s also seemingly no way to start fresh, so I can’t do anything else (I ended up opening a private tab and trying again).

Some feedback:

  • We should be able to remove results from the bulk import results page, and prevent dupes from showing up automatically. This would allow us to use this space as a place to tune our libraries until they’re exactly what we want, and then we can export the files.
  • It would be useful to be able to take action against the “Multiple Matches” and “Not Found” tabs, such that clicking on an entry would open up some interactive search so a user can attempt to resolve the issue and add it to the “Library” tab.
  • The posters should be much smaller, and the first letter/number of the title should not appear as a sibling to posters, but should break up the content. At first I sat there waiting for a poster to load, thinking it was a placeholder, and then realized that is just for alphabetizing the results. FYI: my screenshot is just your page zoomed out.
  • To improve load times on bulk import results, which could show hundreds of images, you can add loading=“lazy” to each `` tag. It’ll not make network requests below the visible viewport, which in this UI would be a good thing. I remember back in the day this used to require a bunch of JavaScript to lazy load, now you can just throw on this attribute.

Here are the titles that were “Not Found,” which may give you something to work on:

Blue Valentine		2010	1:52:04	Derek Cianfrance	Drama
Die Hard 4.0		2007	2:08:49	Len Wiseman	Action & Adventure
Grave of the Fireflies (Dubbed)		1988	1:28:33	Isao Takahata	Anime
Harry Potter and the Philosopher's Stone		2001	2:32:20	Chris Columbus	Kids & Family
Hearts of Darkness: A Filmmaker's Apocalypse		2007	1:35:56	Eleanor Coppola, Fax Bahr & George Hickenlooper	Documentary
Le Fabuleux destin d'Amélie Poulain		2001	2:01:48	Jean-Pierre Jeunet	Comedy
Live Die Repeat: Edge of Tomorrow		2014	1:53:34	Doug Liman	Sci-Fi & Fantasy
Manchester By The Sea		2016	2:17:18	Kenneth Lonergan	Drama
Pan's Labyrinth		2006	1:59:10	Guillermo del Toro	Drama
Shoah: First Era		1985	4:34:11	Claude Lanzmann	Documentary
Shoah: Second Era		1985	4:53:10	Claude Lanzmann	Documentary

Another observation:

I noticed that it seems most of the links generated are devoid of any regional stuff, and yet at least for the Canadian store, it still seems to work. For example, compare the below links. They both open the movie correctly, but your link is shorter, which I actually prefer and that probably triggers some logic in the Apple world to handle the localization internally, which is probably more robust.

https://tv.apple.com/ca/movie/american-beauty/umc.cmc.16daqxpennfm6jm9nkrmtscp

https://tv.apple.com/movie/umc.cmc.16daqxpennfm6jm9nkrmtscp

The codes are the same, but the extra region code and movie title are not included. The former is one generated from links in my region, the latter is the one from Backfil.

Really great feedback, thank you @danemacmillan!!! I’m happy to see Backfil was able to match the majority of your library so well. My match testing has been limited to my own purchased library and friend’s libraries, which as you can imagine is a very small sample size compared to real-world data.

I have reviewed your results to see what can be improved on my side. It looks like the biggest discrepancy is the store origination. Backfil’s matching uses US metadata, specifically from the iTunes Search API. BUT non-US libraries can still match most movies because there is a huge overlap between US and non-US metatdata. Once I implement direct matching against non-US based metadata this will be less of an issue. However, I have seen the same movie have metadata differences even when comparing with the API, library meta, iTunes storefront, and Apple TV storefront from the same country. Things like title, duration, release year, etc can all have drift for the exact same movie across the various sources, it’s wild.

Considering title variations, Infuse handles alternative title names with TMDB flawlessly. For example, “Live Free or Die Hard” vs “Die Hard 4.0” are both identified correctly as being the same movie in Infuse. Another example, “Harry Potter and the Philosopher’s Stone” vs “Harry Potter and the Sorcerer’s Stone” are the same movie and Infuse knows. This is great!

As more people use the service I will fetch data for the highest usage countries to make the results more accurate. As you identified, the actual strmlnk that is created uses a universal link format. There are pros and cons to this approach, but for the intended feature of deep linking a purchased movie within the TV app, it will work for most people. This means that Infuse identifies movies correctly using filenames, regardless of naming variations, and Backfil provides a universal format strmlnk URL, regardless of country. Win-win. Backfil will still have gaps with movies that do not exist in the US though.

For your library specifically, here are additional details to fill in the gaps if you haven’t already:

Naming variations that should work:

Die Hard 4.0    2007  2:08:49 Len Wiseman Action & Adventure
Harry Potter and the Philosopher’s Stone    2001  2:32:20 Chris Columbus  Kids & Family
Hearts of Darkness: A Filmmaker’s Apocalypse    2007  1:35:56 Eleanor Coppola, Fax Bahr & George Hickenlooper Documentary
Live Die Repeat: Edge of Tomorrow   2014  1:53:34 Doug Liman  Sci-Fi & Fantasy

Similar but probably not the same:

Shoah: First Era    1985  4:34:11 Claude Lanzmann Documentary
Shoah: Second Era   1985  4:53:10 Claude Lanzmann Documentary

Not currently available in ATV US:

Blue Valentine    2010  1:52:04 Derek Cianfrance  Drama
Grave of the Fireflies (Dubbed)   1988  1:28:33 Isao Takahata Anime
Le Fabuleux destin d’Amélie Poulain   2001  2:01:48 Jean-Pierre Jeunet  Comedy
Manchester By The Sea   2016  2:17:18 Kenneth Lonergan  Drama
Pan’s Labyrinth   2006  1:59:10 Guillermo del Toro  Drama

Have you been able to test the Backfil created strmlnk files with Infuse yet?

For the alpha and invite codes, I had to implement something as a bot deterrent but make it easy for people. The intention is that people can import their library as much as they need until they get good results, whether that’s into the same import each time or a new import. Info for others: the invite codes can be used an unlimited number of times, just return to the homepage to start over. I will rotate codes if bots catch on and keep this thread updated.

I’m going to tweak things further, especially with matching. Your feedback points are super helpful for direction, thank you! I did not know about the lazy loading, I will be adding that. Definitely the UI could use some love :sweat_smile: Tailwind has been excellent to get ideas from wireframes to features fast.

Also, thank you @james for letting this tool be discussed here :heart: I think Backfil can provide real value to Infuse users with Apple TV libraries that want their local and purchased collections to co-exist.

Happy to help. This is something that piqued my interest as there is an obvious gap for these files online and yours is the first solution that handled it in a straightforward manner.

Other valid matches (universal):

  • Le Fabuleux destin d’Amélie Poulain 2001 2:01:48 Jean-Pierre Jeunet Comedy:
    • Just called “Amelie” in universal store.
    • https://www.backfil.com/videos/1eceacc5-557d-4bb1-ac22-13504fe508cd

Available in CA store and works:

  • Blue Valentine 2010 1:52:04 Derek Cianfrance Drama
    • https://tv.apple.com/ca/movie/blue-valentine/umc.cmc.1s50v69dtld6u8329cfiuthnr
  • Manchester By The Sea 2016 2:17:18 Kenneth Lonergan Drama
    • https://tv.apple.com/ca/movie/manchester-by-the-sea/umc.cmc.2zz8wiwkw06s5lzqbl8lqw69l

Unavailable in CA Store (and maybe nowhere, either):

  • Pan’s Labyrinth 2006 1:59:10 Guillermo del Toro Drama

    • Link opens page but no play button.
    • https://tv.apple.com/ca/movie/pans-labyrinth/umc.cmc.4og9i55k8iyps0m7zadae33lt
  • Shoah: First Era 1985 4:34:11 Claude Lanzmann Documentary

    • Not the same as “Genocide” that you linked
    • Link goes nowhere in TV.app, but opens on Web.
    • https://tv.apple.com/us/movie/shoah-first-era/umc.cmc.3rkdl43ispo5fifrj2phe1zk1
  • Grave of the Fireflies (Dubbed) 1988 1:28:33 Isao Takahata Anime

    • No link at all anymore.

Spot checks in Infuse look good. Pretty much have them all in.

Some misdated or unmatched movies:

To be fair about the dates, though, Apple/iTunes does such a bad job with their metadata, so it’s really hit or miss.

Random idea:

  • Maybe consider codifying IMDB and TMDB IDs in the filenames to improve matching. Not sure how standardized that naming convention would be, but at least Infuse would support it.

I found an incorrect match in Backfil:

Men 2022 1:40:22 Alex Garland 2022-12-24, 6:58 PM Horror

Returns this:

It should be this one:

Your spot checking is super helpful @danemacmillan! For clarifications on some of those scenarios:

  • For the movies that are unavailable in the CA store, are you still able to watch them by accessing the movies from your ATV library?
  • Do you remember buying the now unavailable movies directly from ATV or are did they come from somewhere else? For example, I have an extended edition of The Martian that was added using Movies Anywhere, but ATV has never sold that version, although I am able watch it from my ATV library.
  • For the movies that Backfil has the wrong titles and/or release year in the output filename, what is the behavior with Infuse:
    • No meta match at all or do some just match to the wrong movie?
    • Despite no match or the wrong match, does the Infuse “Open” button link to the expected movie in ATV?

Like I mentioned before, I have seen the store display one year vs my purchased library displaying a different year. For the sake of Backfil, I am relying on library metadata to match the API data, but I have examples of those sources differing as well. I have additional ideas on how to overcome this data drift beyond what I have implemented so far.

There are two matches Backfil is trying to solve:

  1. Match a purchased movie’s metadata to API data for the purpose of retrieving an ATV ID
  2. Output the correct title and year as a filename for Infuse to match with TMDB

For #1 Backfil is close. I have some changes to make, but I think the biggest lift will be matching regional metadata properly. Based on the alpha testing from everyone, implementing API data from Canada and Germany will be the likely additions to start with.

That’s a good idea for #2, to use TMDB or IMDB naming and/or IDs to ensure a proper match within Infuse. It looks like there are many different ways to accomplish this, I just need to correlate the API data with those ID sources.

The alpha testing is giving me the info that I was lacking for the next improvements. Thank you @danemacmillan and others that have imported their libraries. Give it a try if you haven’t yet!

Two questions:

1.) Can this program run on a PC as far as importing movies for creation of streamlink files?

2.) Does this work with your TV Show library?

  1. Yes, it is a website. Go to www.backfil.com and search for movies, then you can download individual strmlnk files. I need to verify if the Windows Apple TV app provides the same copy/paste library feature that is necessary to bulk import. Or you could try with the same instructions as the first post: Apple TV / iTunes movie library strmlnk creator
  2. Not yet, but that will be supported in the future.
1 Like

omg i have been doing 300 strmlnk files on notepad for so long,this is great, sadly the copy command on Windows app doesnt work. ill wait for the future, hopefully MX store will be compactible.

Good news @emmanuelsntz and @ScottA, I have verified that iTunes on Windows does allow copying your entire movie library still! Open iTunes, switch the dropdown to “Movies”, and then Ctrl + A and Ctrl + C within iTunes, then Ctrl + V in your browser into Backfil for bulk import. Also in iTunes, you can toggle to list view using “View > View As > List” to refine your selection.

I’m going to update the import instructions for Mac and Windows to note that the movie Title/Name needs to be very first when you are copy/pasting (for now). Other columns to include that will improve results are: Year, Time, Director / Artist, and Genre. These other columns will self-identify themselves, so order is not important. Do not include the movie Description column, it can throw off the formatting.

To answer your bulleted questions:

  • Yes, all movie purchases are still available in my Apple TV library, but some of them can no longer be opened in the more modern Apple TV UI, but instead open up in their really generic UI that looks a couple decades old: anyone who’s bought content through Apple TV / iTunes should know what I mean by this, lol. This is due to no longer being licensed by Apple, as I understand it.
  • I’ve never purchased digital content like movies or TV shows from any other platform other than Apple TV. I’m very much bought into the ecosystem and do not like fragmentation.
  • To answer these nested questions:
    • It’s a mix of both. Some do not match anything in Infuse, while others are mismatched. In fairness to both sides, Infuse is being fed the wrong dates, but so is Backfil.
    • The open link works, and it’s the only way to further an audit. For example, the movie I mentioned above (“Big Men (2014)”) should have just been “Men (2022).” In this case, Backil mismatched to Big Men, and even the link to Apple TV was Big Men, and Infuse obviously matched Big Men, but that wasn’t the movie at all. In other cases, such as “Ringu (1998),” it matched nothing in Infuse, but upon opening the link it was linked to the correct foreign horror movie, at which point I renamed the strmlnk file to auto-match later. In another case, I own “Frosty the Snowman” from 1969, but Apple TV has it dated as 2021, which also happens to correspond with a remade version that shares the same year, and so if you look for that title on Backfil, you’ll see them both dated to 2021, but one is obviously from 1969.

I think when it come to release dates, it’s always going to be imperfect. We even see this in the strong opinions of moderators on services like TMDB, MovieDB, TheTVDB, etc, where they adamantly debate the correct ordering of shows based on original air dates, DVD release, or with movies that are remastered vs original release. Apple TV metadata itself is really a mess, and actually pretty frustrating to deal with, particularly when it comes to buying full TV shows that do not split out seasons, which usually result in sorting by the episode numbers from each season all being together, meaning that a show with eight seasons will have eight “episode 1” files, so all eight are placed next to each other, etc, resulting in a total lack of organization… so you need to jump into the proper Apple TV UI that is integrated with services instead of your proper library. Anyway, I’m just ranting.

Your logic will have to codify some tolerance for acceptable vs not and then kind of settle on that, otherwise you’ll be forever chasing your tail trying to perfect it; ultimately, the logic you settle on should be as close to most people’s and services’ established standards and expectations with some of your own opinions in the mix in order to keep sane. If that means also drawing from other APIs to get more sources to build a decision tree, then that might be a path forward.

I think at some point if you start building out the way to modify or correct matches in Backfil, then you probably have enough information to really crowdsource these edits, where you could collect the original match, see what was corrected, collect a reason from a preset list of reasons why an edit was made, what service and region its from, and then you could have your own collected knowledge base as yet another layer you apply to matches: a kind of final layer before providing a match to a user. Initially that local knowledge base will be small, but eventually it’ll be very powerful to catch all the known misdated movies and other metadata from a service like Apple TV. That’ll actually be one thing that will really provide the value-add that other services attempting the same thing might lack; that’s the data that gives a business real value and the stuff companies buying other companies are after.

Happy to help!

1 Like

Some updates to Backfil

  1. Search for movies by title, director, and/or year from the search bar
  2. Mac and Windows import instructions have been added
  3. Post-import match details have been added to assist with auditing results
  4. Import logic has been improved to be more accurate and faster:
  • The most accurate results depend on importing using only these 4 columns–
    • Title, Director, Time, Year (any order)
  • Non-US titles, including non-English titles, also have greater match accuracy if those 4 columns are used

Movies continue to be matched using US iTunes data, HOWEVER, I have been able to import non-US titles with a high success rate. If you have attempted to import your library previously and didn’t have 100% accurate results (especially if you are not in the US), try again to see how much accuracy has improved.

I am going to keep the alpha phase going to see how these new import results track for people. I am still planning to fetch movie data for other countries along with integrating TMDB data for more accurate strmlnk filenames within Infuse.

The first post provides the best instructions for using Backfil. To summarize, backfil.com is a website that creates strmlnk files for movies purchased from Apple TV. You can download strmlnk files for individual movies or import your entire purchased library at once to download all. These strmlnk files can be used to open Apple TV movies from Infuse.

As always @danemacmillan, your detailed testing and notes have been incredibly valuable. Thank you.

YES, that has long been a frustration of mine as well! I’m hoping Backfil can provide a more usable UI and/or strmlnk’s for Infuse once I fetch TV Shows to solve this exact problem. I have a hacky version of this running locally but it needs more work to be useful.