A script that always exclude results from certain countries in imdb advanced title search
You can just press Ctrl+A in the country list to select all the options, then Ctrl+LMB to unselect the unwanted one.
Give me some urls as examples.
Also be more specific about which countries you want to see,and which countries you don't want to see
You can just press Ctrl+A in the country list to select all the options, then Ctrl+LMB to unselect the unwanted one.
Woah! Never thought of this..
It does seem to work though but there's a little problem. If there were any titles that are not tagged with countries/languages, those won't be included in results anyway if I follow your method. Otherthan that, I'm pretty happy with the results.
Thanks alot for replying!
Give me some urls as examples.
Also be more specific about which countries you want to see,and which countries you don't want to see
Here's a URL generated for the below parameters.
title type=feature film
min user rating=7.0
no of votes=50000
min runtime=190
https://www.imdb.com/search/title/?title_type=feature&user_rating=7.0,&num_votes=50000,&runtime=190,
If you scroll down abit, there are some indian movies that show up in results that I have no interested in. To exclude them; you've to manually add &countries=!in
or &!countries=in
parameter to the URL
Both of the above results URLs list all movies that fit into above parameters EXCLUDING titles from india.
Now if I were to perform lots of different searches like this, I always have to manually add &countries=
parameter to the URL with not operator since there is no proper way to achieve this in ATS page.
What I was hoping for was, despite what other parameters I select in advanced title search page, results URLs will always include &countries=!in
parameter so that those results will always be excluded.
Basically if you set values in ATS as above it will take you to 1st URL I've listed. What I want is to automatically add !countries
parameter to every URL upon the click of search button so the end result would look like either 2nd or 3rd URL.
Or to invert the function of "countries" field in ATS page, as by default its set to INCLUDE results ONLY from selected country. I wanted to reverse that function to EXCLUDE titles from selected country.
Wow, that was a pretty detailed answer, thanks
It's very easy and fast to make a script that adds &countries=!in to the url
When the url matches this url "https://www.imdb.com/search/"
It's "harder" and takes a bit more time to make this be added to the url only when the search button is clicked
Does this
It's very easy and fast to make a script that adds &countries=!in to the url
When the url matches this url "https://www.imdb.com/search/"
Works for you?
Wow, that was a pretty detailed answer, thanks
It's very easy and fast to make a script that adds &countries=!in to the url
When the url matches this url "https://www.imdb.com/search/"
It's "harder" and takes a bit more time to make this be added to the url only when the search button is clicked
Does this
It's very easy and fast to make a script that adds &countries=!in to the url
When the url matches this url "https://www.imdb.com/search/"
Works for you?
Well, @darkred managed to create a simple script that basically adds &countries=!in
whenever the URL pattern matches ATS URL however that does not work when you want to perform multiple searches back and forth :(
If you have some free time, please look into making it work when the search button is clicked and it will carry whatever parameters set in the ATS as well as !countries
parameter so that those results will always be excluded no matter what the search query is.
Do take your time. I'm not in a hurry :) TIA
When the url starts with 'https://www.imdb.com/search/title/?title_type=feature', the script will add &countries=!in after ?title_type=feature before the website loads
If the url already has the word 'countries' on it, the script will stop working and won't add '&countries=!in' to the url
// ==UserScript==
// @name Remove Countries on IMDB Search
// @namespace LessCountries
// @version 0.1
// @description Remove Countries on IMDB Search.
// @author hacker09
// @match https://www.imdb.com/search/title/?title_type=feature*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (!location.href.match('countries')) {
document.location.replace(document.location.href.replace('https://www.imdb.com/search/title/?title_type=feature', 'https://www.imdb.com/search/title/?title_type=feature&countries=!in'));
}
})();
When the url starts with 'https://www.imdb.com/search/title/?title_type=feature', the script will add &countries=!in after ?title_type=feature before the website loads
If the url already has the word 'countries' on it, the script will stop working and won't add '&countries=!in' to the url
// ==UserScript==
// @name Remove Countries on IMDB Search
// @namespace LessCountries
// @version 0.1
// @description Remove Countries on IMDB Search.
// @author hacker09
// @match https://www.imdb.com/search/title/?title_type=feature*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (!location.href.match('countries')) {
document.location.replace(document.location.href.replace('https://www.imdb.com/search/title/?title_type=feature', 'https://www.imdb.com/search/title/?title_type=feature&countries=!in'));
}
})();
Woah! Thanks for this! It's already an improvement.
Please do adjust the @match URL to work with more types (eg:tv shows) then the URL pattern changes to ...title/?title_type=tv_series&...
// ==UserScript==
// @name Remove Countries on IMDB Search
// @namespace LessCountries
// @version 0.1
// @description Remove Countries on IMDB Search.
// @author hacker09
// @match https://www.imdb.com/search/title/?title_type*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (!location.href.match('countries')) {
document.location.replace(document.location.href.replace(location.href.split('&')[0], location.href.split('&')[0]+'&countries=!in'));
}
})();
// ==UserScript==
// @name Remove Countries on IMDB Search
// @namespace LessCountries
// @version 0.1
// @description Remove Countries on IMDB Search.
// @author hacker09
// @match https://www.imdb.com/search/title/?title_type*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (!location.href.match('countries')) {
document.location.replace(document.location.href.replace(location.href.split('&')[0], location.href.split('&')[0]+'&countries=!in'));
}
})();
This is near perfect! Except if you didn't select type (to include results from all types) script does not work. I am sorry, I should have thought of this last time :( Otherthan that, it does exactly what I wanted!
Thanks a ton for your time! You sir have saved lot of time for me by not having to modify each and every search URLs in the future! ^^
Maybe if you replace
// @match https://www.imdb.com/search/title/?title_type*
to
// @match https://www.imdb.com/search/title/*
The script will work.If doesn't then give me some urls that doesn't have title/?title_type
Maybe if you replace
// @match https://www.imdb.com/search/title/?title_type*
to
// @match https://www.imdb.com/search/title/*
The script will work.If doesn't then give me some urls that doesn't have title/?title_type
It did work! Thanks alot, again!
You are welcome
There is no option to exclude results from certain countries in the UI of the imdb advanced title search page however this can be achieved by modifying "countries" parameter in the url of search results.
I would really like to have a script with either hardcoded values that always inject
&countries=!xy
parameter to every advanced search urls (in my case: =!in) OR modify the function of default "countries" field in advanced title search page to EXCLUDE results from selected country instead of only including results from that country.Thanks in advance.