[UPD ES] Filmaffinity 4.0

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Radagast
Posts: 42
Joined: 2016-04-22 16:07:15

Re: [UPD ES] Filmaffinity 4.0

Post by Radagast »

m2s wrote: 2025-07-11 17:38:03 Te sugiero que en lugar de poner el título de la película en la búsqueda, pongas directamente la dirección web de la misma.
Ejemplo, la última de Superman la buscas con su enlace que es "https://www.filmaffinity.com/es/film811435.html"
A mi me funciona bien.
Poniendo el nombre de la pelicula también funciona. El problema como le he comentado a Antp en una respuesta anterior es que si la película tiene más de 1 pagina de resultados en la web de filmaffinity hay que repetir el proceso de salvar la pagina tantas veces como paginas de resultados tenga la película. Es decir si una pelicula tiene 10 paginas de resultados pues hay que salvarla y volver al script 10 veces.
Al poner directamente la dirección HTML de la pagina de la película pues te saltas el proceso de búsqueda por eso es más rápido.
A ver si Antp o alguien que sepa modifica el script para hacer la búsqueda directamente en la web y hacerlo más facil de funcionar el script
Radagast
Posts: 42
Joined: 2016-04-22 16:07:15

Re: [UPD ES] Filmaffinity 4.0

Post by Radagast »

masterchipo wrote: 2025-07-16 18:51:32 Y seguí intentando, pero no hubo forma.
Agradezco a todos los implicados, pero no me funciona la ruta.
Probé con todo y todas las C D ,cree una carpeta de temporales en descarga y no me sale la información encuentra la película al apretar f6 pero no guarda la información en el lugar correcto.
Seguiré usando IMDB, hasta que se pueda solucionar esto
Lo conseguiste compañero?
Radagast
Posts: 42
Joined: 2016-04-22 16:07:15

Re: [UPD ES] Filmaffinity 4.0

Post by Radagast »

MrObama2022 wrote: 2025-07-21 15:32:33 Ok, I just finished. This works on my pc BUT PLEASE DON'T USE. THIS IS ONLY FOR STUDY, LOOK AT THE CODE BUT DON'T USE. I HAVE TO DO A LOT OF TEST. REPEAT: DON'T USE AND WAIT, THIS IS AN HIGHLY EXPERIMENTAL VERSION

ExternalCurlHandler.pas
FilmAffinity (ES).ifs unofficial 5.0 alpha 1

Here’s how it works. All the work is handled by an external library, ExternalCurlHandler.pas.
FilmAffinity (ES).ifs is based on the old version of the script and works as usual. Very little has changed:
now it uses ExternalCurlHandler.pas instead of StringUtils7552 (which is already called by ExternalCurlHandler.pas); it uses GetPage5Advanced() instead of GetPage(), and when starting, it performs a check to see if the PC setup is okay (if (not setupScript()) then exit;).
So far, everything is very simple. This approach allows any script to make use of ExternalCurlHandler.pas without being heavily changed: you just reference the unit in place of StringUtils7552, replace GetPage() with GetPage5Advanced(), and (optional) apply the initial check.

The library does one simple thing: through the setupScript() function, it creates a subfolder in which it places a single batch file.
If your catalog is located at D:\catalogs\movies.amc, the subfolder will be D:\catalogs\movies_curlscript\, and inside it, the created file will be called setup.bat.

This file needs to be run only once (I still have to make changes to handle more catalogs!).
So, the first time FilmAffinity (ES) is launched, it creates this file and you’ll be asked to close the window and run the `setup.bat` file.

The GetPage5Advanced() function, on the other hand, is an alternative to GetPage5() with the same parameters, but it is based on curl.
It writes the URL (and the headers) to call into a text file (curlRequestHeaders.txt) and waits for a response text file (curlOutput.html).
At the moment, the function still needs to be completed, but it already works partially.
This was my original idea.

The magic is done by the setup.bat file, which performs some fairly complex operations:

1. It checks if Task Scheduler has a process called ExternalCurlHandler. If this process doesn’t exist, it creates it (it asks for admin permission).
This process will automatically run every time the PC starts and will execute the file ExternalCurlHandler.ps1.
The ExternalCurlHandler.ps1 file is the one that waits for curlRequestHeaders.txt to appear and then generates the `curlOutput.html` file.

2. It creates the file ExternalCurlHandler.ps1 if it doesn’t already exist.

3. It manually starts ExternalCurlHandler.ps1 if it's not already running (so you don't need to reboot your pc).

I’ve tested the entire setup locally on my PC and it works. You need Windows 10 or 11, I don't know if this could works on Windows 7 or 8 (maybe ...)
For the end user, aside from the initial setup, everything is transparent — nothing changes, and the script works as it always has.
No browser launches, execution time is the same — everything is identical: 100% the same as before.

I tested both by searching with "Superman" and by directly providing the URL:
[https://www.filmaffinity.com/es/film811435.html](https://www.filmaffinity.com/es/film811435.html)

The only limitation of this solution is image handling — but fortunately, for movies, there are no changes needed in this script regarding that.

This is a "last chance option" when everything fails and you still need to access to a site. This will never be an official version and you will never find it in official release and official update scripts.
Thank U very much MrObama2022, U are doing a great job. As I can understand U are doing something similar as option 2 I suggest to Antp some weeks ago, use an intermediary to download the HTML.
Radagast wrote: 2025-06-28 04:31:34 To @antp and @fulvio53s03, do you think any of these ideas could work and carry out? At the moment you are the only ones that have knowledge to know if any could work. As I guess what the scripts do is to download the HTML code, analyze it and extract the information from the HTML code. I use Firefox and can download the webpage of the movie and also can view the HTML code and copy to TXT file, I test it.

1- I use www.filmaffinity.com usually and I have an account. It would be possible to modify the script to use user and password to login as I do in the browser. Could this bypass the protection? Long time ago I use another software that need the login information to get the information from a web.

2- It would be possible to modify the script to use the browser (Chrome, Edge, Firefox, etc ...) as an intermediary, like a kind of proxy. I want to say that the script tells the browser what have to browse and that the browser download the page in a file (HTML, etc...) that the script can analyze and extract the information

3- I think that possibly the most laborious to seek information when we use the program, but maybe the easy way to modify the script.
Would it be possible to modify the script so can get the information from an HTML file, or other file type, previously downloaded with the browser?
Maybe it is possible to put an option in the script to change between obtaining the information from the web or from a file.
And when the option from the file is activated the script will ask about the path to HTML or another file type previously downloaded with the browser and extract the information from the file.

Thanks
Waiting to test it when U have the final release.
U are our hero!! :clapping:
Radagast
Posts: 42
Joined: 2016-04-22 16:07:15

Re: [UPD ES] Filmaffinity 4.0

Post by Radagast »

MrObama2022 wrote: 2025-07-22 15:52:25 That's why I think my library is useful ... because if more and more sites start using JA3 and JA4+ (and JA3 and JA4+ are part of cloudflare ...), we can still use AMC "as usual" thanks to that library. With ANY site. Now that my library use native curl and we can play with parameters but tomorrow can use a different curl or wget or postman or chromium (hopefully in no-gui/hidden mode) with an ad-hoc extension. This library is a "plan B" for "hard to abate" firewalls. I still have to test with GetPicture but I have one or two ideas.

Off topic: about legal question, I'm not a lawyer (my wife is) but I think AMC is like an ad-blocker or a personal ia agent: final user uses it for a different approach to a site page. You don't host these informations on cloud, you don't resell/earn from these informations and you are not sharing them with anyone. It's the user who use a different client to read the information on the website. Also blind people use specific client to access website. In my country, Italy, there is not a law asking to only use official web browser without any ad-blocker/other extension to access a website. Brave browser is still legal ... :D
I think so too.
Sure your library also is useful in this similar error with IAFD script
viewtopic.php?t=43152
antp
Site Admin
Posts: 9742
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Re: [UPD ES] Filmaffinity 4.0

Post by antp »

Radagast wrote: 2025-07-28 01:54:59 If U let me suggest something (and U or someone with the knowledge have time to do), I think it will let to use the script a bit more fast and easy. I try but my knowledge it's not enough. That I think it's to Bypass/delete the search part of the script, do the search directly at the browser will be more fast and easy.
So the process will be something like that.
1-The script ask for title or movie address
2-Show message "In the next window, a file path will be shown (you can modify it if you want, and change the default value in script parameters). Please copy that file path. Then when you click "OK", the web browser will open the search page. Please, search for the movie page, open it and then save the movie page (Ctrl+S), select "Webpage, HTML only" as type, and paste the file path as name. Once done, you can close the browser and continue here." then we click OK
3-Show message "Copy this path then click "OK":" then we click OK
4-Show message "Click OK when you saved the movie page with the web browser." then the browser open the advance search page, we search for the correct movie, open movie page, save it and click OK.
5-Then the script analyze the movie page as usual to extract the information.

I think on this way the script will be more friendly to use.

PD: It will be a good idea too to put an option in the script to bypass the messages from the steps 2 and 3 and go directly from step 1 to step 4 message "Click OK when you saved the movie page with the web browser.".
At first times of use the steps 2 and 3 are needed to inform how to use the script. But after some times this messages only make the use of script more slowly, we will know that always will need to overwrite again and again the HTML file every time we add a new movie. So activating the option we can bypass the steps 2 and 3 messages.
Hi,
Indeed, it would be much more efficient to let the user do the search in the browser and only import the final page.
And good remark about the option to skip messages.
I'll try to make these tweaks in the next days, when I've a few minutes for that ;)
MrObama2022
Posts: 117
Joined: 2022-02-02 00:03:55

Re: [UPD ES] Filmaffinity 4.0

Post by MrObama2022 »

I did it.

This is the 5.0 Unofficial. Remember: this is Unofficial version.

FilmAffinity (ES).ifs
ExternalCurlHandler.pas

You can rename as FilmAffinity Unofficial (ES).ifs if you prefer.

You don't need any video, this should simply work.

CHANGELOG
* I no more use Task Scheduler so I don't need admin permissions
* The new script is very very clean and simple: AMC now use curl.exe to get pages

How I did it. I don't want other windows or popup or bash windows in my screen so the ifs script creates a vbs file (only the first time) and write the curl command in a powershell file. Ant Movie Catalog use Launch to open vbs file AND vbs file is executed without window. vbs open then open powershell to execute the curl command (maybe I could use curl inside the vbs file but who care for a cleaner script, maybe next release, I'm a bit tired). The powershell use curl (with useragent set) to grab the url and save it in a .tmp file and then rename it.
Ant Movie Catalog, after launching the vbs file, check if the output file exists; when it found the out file, AMC reads the file and delete it. Done.

The ExternalCurlHandler.pas can be used also with other script. It uses GetPage5Advanced instead of GetPage5, with the same parameters (I had no time to add them in the script, maybe next release)

PRO
* You can use AMC and Filmaffinity as usual
* Fast enough

CONS
* This could not work in the future. If not work, you can update curl command or user agent in the script BUT if cloudflare improve or change its settings this script could be useless
* This script is unofficial so you will not receive updates using the update script, you must manually update it if new version will be released

SETUP
Windows 10 or 11, latest versions: no setup needed
Windows 7 or 8: install curl.exe and add its path to %PATH% in Windows (here a simple guide)

TIPS
* If you don't want ExternalCurlHandler.vbs and ExternalCurlHandler.ps1 are created in your AMC script dir, open ExternalCurlHandler.pas and set tmpDir (examples: C:\tmp\ OR C:\Users\MYUSERNAME\AppData\Local\Temp\ )
* if you need to change the useragent or the other headers, first try from powershell prompt, then update these 2 lines

Code: Select all

  curlUserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36';

Code: Select all

  fileContent.Add('& ' + curlPath + ' -L --output ''' + InstallerPath + curlOutputTmp + ''' --url ''' + address + ''' ' + '-H ''Accept: text/html, */*'' -H ''Accept-Language: it'' -H ''DNT: 1'' -H ''Priority: u=0, i'' -H ''Sec-Ch-Ua: "Not)A;Brand";v="8", "Chromium";v="138", "Google Chrome";v="138"'' -H ''Sec-Ch-Ua-Mobile: ?0'' -H ''Sec-Ch-Ua-Platform: "Windows"'' -H ''Sec-Fetch-Dest: Document'' -H ''Sec-Fetch-Mode: Navigate'' -H ''Sec-Fetch-Site: None'' -H ''Sec-Fetch-User: ?1'' -H ''Upgrade-Insecure-Requests: 1'' -H ''User-Agent: ' + curlUserAgent + ''' 2>$null');


TO DO (optional, for next release)
* improve GetPage5Advanced to use also the other paramaters (... sorry for this ...)
* add GetPicture3Advanced()
* try to use curl inside vbs without using powershell

That's all folks.
masterchipo
Posts: 116
Joined: 2010-02-22 23:15:05

Re: [UPD ES] Filmaffinity 4.0

Post by masterchipo »

Radagast wrote: 2025-07-28 03:26:08
masterchipo wrote: 2025-07-16 18:51:32 Y seguí intentando, pero no hubo forma.
Agradezco a todos los implicados, pero no me funciona la ruta.
Probé con todo y todas las C D ,cree una carpeta de temporales en descarga y no me sale la información encuentra la película al apretar f6 pero no guarda la información en el lugar correcto.
Seguiré usando IMDB, hasta que se pueda solucionar esto
Lo conseguiste compañero?
No compañero y amigo, y ahora con esto de MisterObama y su vocabulario técnico y para colmo de males (míos) en inglés, no entiendo una pepa.
Actualizar, no actualizar, esa es la cuestión.
¿Y cómo?
Por favor para los lelos como yo (sin insultar a los lelos) explicación o link y expliquen en español que debemos hacer para actualizar Folmaffinity.
Amigos no se entiende nada y cada vez me pongo más ansioso
MrObama2022
Posts: 117
Joined: 2022-02-02 00:03:55

Re: [UPD ES] Filmaffinity 4.0

Post by MrObama2022 »

Si tienes Windows 10 o Windows 11, haz lo siguiente: descarga este archivo y también este otro archivo en C:\ProgramData\Ant Movie Catalog\Scripts

Listo. Luego, con calma, intenta releer mi post y dime qué no te queda claro.
masterchipo
Posts: 116
Joined: 2010-02-22 23:15:05

Re: [UPD ES] Filmaffinity 4.0

Post by masterchipo »

MrObama2022 wrote: 2025-07-30 08:36:29 Si tienes Windows 10 o Windows 11, haz lo siguiente: descarga este archivo y también este otro archivo en C:\ProgramData\Ant Movie Catalog\Scripts

Listo. Luego, con calma, intenta releer mi post y dime qué no te queda claro.
:o :D Es que está en inglés y yo no entiendo ni siquiera usando el translator, Barak.
Thanks (eso lo sé) ;)
Radagast
Posts: 42
Joined: 2016-04-22 16:07:15

Re: [UPD ES] Filmaffinity 4.0

Post by Radagast »

MrObama2022 wrote: 2025-07-29 20:59:51 I did it.

This is the 5.0 Unofficial. Remember: this is Unofficial version.
Thank U MrObama2022. Great job. This weekend I will test it with many movies.

MrObama2022 wrote: 2025-07-29 20:59:51 CHANGELOG
* I no more use Task Scheduler so I don't need admin permissions
I try it with AMC portable from a pendrive in a computer without admin permissions and it's work fine.

MrObama2022 wrote: 2025-07-29 20:59:51 You can rename as FilmAffinity Unofficial (ES).ifs if you prefer.
I did it. And I also change in the script the line Title=FilmAffinity (ES) to Title=FilmAffinity Unofficial (ES) so I can have both scripts living together.
Radagast
Posts: 42
Joined: 2016-04-22 16:07:15

Re: [UPD ES] Filmaffinity 4.0

Post by Radagast »

antp wrote: 2025-07-29 07:20:02 Hi,
Indeed, it would be much more efficient to let the user do the search in the browser and only import the final page.
And good remark about the option to skip messages.
I'll try to make these tweaks in the next days, when I've a few minutes for that ;)
Thank U very much Antp.
As I said before it's good to have the two versions. Now MrObama2022 script don't need administrator rights so it could be used in all computers, but as he say maybe in the future his script will stop to work. And how I imagine the part that analyze the HTML it's the same in both scripts so if FilmAffinity change something in the page, the improvement made in one script could be used in the another. The main difference it's the way that every script uses to obtain the HTML
Radagast
Posts: 42
Joined: 2016-04-22 16:07:15

Re: [UPD ES] Filmaffinity 4.0

Post by Radagast »

masterchipo wrote: 2025-07-30 10:05:16
MrObama2022 wrote: 2025-07-30 08:36:29 Si tienes Windows 10 o Windows 11, haz lo siguiente: descarga este archivo y también este otro archivo en C:\ProgramData\Ant Movie Catalog\Scripts

Listo. Luego, con calma, intenta releer mi post y dime qué no te queda claro.
:o :D Es que está en inglés y yo no entiendo ni siquiera usando el translator, Barak.
Thanks (eso lo sé) ;)
Tranquilo compañero, es muy sencillo. Primero de todo descarga los 2 archivos que te indica MrObama2022 en la carpeta C:\ProgramData\Ant Movie Catalog\Scripts. Para el primero te preguntará si quieres sobreescribirlo, dile que sí. Una vez tengas los 2 archivos copiados, abres AntMovieCatalog y lo haces como siempre.
antp
Site Admin
Posts: 9742
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Re: [UPD ES] Filmaffinity 4.0

Post by antp »

Radagast wrote: 2025-07-31 06:05:54 Thank U very much Antp.
As I said before it's good to have the two versions. Now MrObama2022 script don't need administrator rights so it could be used in all computers, but as he say maybe in the future his script will stop to work. And how I imagine the part that analyze the HTML it's the same in both scripts so if FilmAffinity change something in the page, the improvement made in one script could be used in the another. The main difference it's the way that every script uses to obtain the HTML
The version from MrObama2022 could maybe be used as official one, with an option to specify if it uses cURL or not, I have to think about that and check the new code, but I haven't yet had time for that, it will be for later, for the moment I don't have much time for it :)
Post Reply