Are you sure you want to go to an external site to donate a monetary value?
WARNING: Some countries laws may supersede the payment processors policy such as the GDPR and PayPal. While it is highly appreciated to donate, please check with your countries privacy and identity laws regarding privacy of information first. Use at your utmost discretion.
The script doesn't recognize movies that have a double quote character.
For example:
http://www.imdb.com/title/tt0095675/
Mujeres al borde de un ataque de "nervios" (1988)
A fragment from an exported csv:
"1753","tt0095675","Wed Dec 28 00:00:00 2011","","","Mujeres al borde de un ataque de "nervios","Feature Film","Pedro Almodóvar","5","7.6","90","1988","comedy, drama","21371","1988-03-14","http://www.imdb.com/title/tt0095675/"
I assume the issue is with the regex from the function
downloadOK
, which doesn't expect badly formed CSVs from IMDb:var regex = /"tt[0]*(\d+)","[^"]*","[^"]*","[^"]*","[^"]*","[^"]*","[^"]*","([^"]*)","([^"]*)"/;
This change seems to help (unless there's a movie with a title like "Breaking", Bad CSVs, in which case the regex will probably need to match whole lines up to the line break):
var regex = /"tt[0]*(\d+)","[^"]*","[^"]*","[^"]*",".*?","[^"]*","[^"]*","([^"]*)","([^"]*)"/;
Re: @monk-time:
Nice catch, monk-time! Thanks for the great bug report!
Yes, I was lazy an naive, so I trusted that IMDb would always produce a valid CSV file. It doesn't. So I changed the code from using regex to something hopefully more robust and legible. At first it seemed to work fine, but then I found another problem with the IMDb data (notice the line feed after "Morto":
"798","tt0365748","Thu Feb 16 11:00:00 2006","Wed Aug 10 20:05:39 2011","Todo Mundo Quase Morto (ou Zombies Party - Uma Noite... de Morte?)","Shaun of the Dead","Feature Film","Edgar Wright","10","8.0","99","2004","comedy, horror","330366","2004-03-29","http://www.imdb.com/title/tt0365748/"
Now this will cause the following output in the console:
[!] 5 fields in "798","tt0365748","Thu Feb 16 11:00:00 2006","Wed Aug 10 20:05:39 2011","Todo Mundo Quase Morto [!] 12 fields in (ou Zombies Party - Uma Noite... de Morte?)","Shaun of the Dead","Feature Film","Edgar Wright","10","8.0","99","2004","comedy, horror","330366","2004-03-29","http://www.imdb.com/title/tt0365748/" [X] Error getting IMDb const from: (ou Zombies Party - Uma Noite... de Morte?)","Shaun of the Dead","Feature Film","Edgar Wright","10","8.0","99","2004","comedy, horror","330366","2004-03-29","http://www.imdb.com/title/tt0365748/"
Well, I don't think it's worth working around all possible CSV problems, so I think I'll try to submit a bug report to IMDb. As lazy as I am, I noticed that the code still works for me even with the error above, but let me know if you have any problem.
FIY, here are the changes I've made: