com.moviejukebox.plugin.ImdbPlugin Maven / Gradle / Ivy
Show all versions of yamj Show documentation
/*
* Copyright (c) 2004-2012 YAMJ Members
* http://code.google.com/p/moviejukebox/people/list
*
* Web: http://code.google.com/p/moviejukebox/
*
* This software is licensed under a Creative Commons License
* See this page: http://code.google.com/p/moviejukebox/wiki/License
*
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.plugin;
import com.moviejukebox.model.*;
import com.moviejukebox.scanner.artwork.FanartScanner;
import com.moviejukebox.tools.*;
import static com.moviejukebox.tools.PropertiesUtil.FALSE;
import static com.moviejukebox.tools.PropertiesUtil.TRUE;
import static com.moviejukebox.tools.StringTools.*;
import java.io.IOException;
import java.text.NumberFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
public class ImdbPlugin implements MovieDatabasePlugin {
public static String IMDB_PLUGIN_ID = "imdb";
private static final Logger logger = Logger.getLogger(ImdbPlugin.class);
private static final String logMessage = "ImdbPlugin: ";
protected String preferredCountry;
private String imdbPlot;
protected WebBrowser webBrowser;
protected boolean downloadFanart;
private boolean extractCertificationFromMPAA;
private boolean getFullInfo;
protected String fanartToken;
protected String fanartExtension;
private int preferredPlotLength;
private int preferredBiographyLength;
private int preferredFilmographyMax;
private int preferredOutlineLength;
private int peopleMax;
private int actorMax;
private int directorMax;
private int writerMax;
private int triviaMax;
protected ImdbSiteDataDefinition siteDef;
protected ImdbInfo imdbInfo;
protected static final String plotEnding = "...";
private boolean skipFaceless;
private boolean skipVG;
private boolean skipTV;
private boolean skipV;
private List jobsInclude;
private boolean scrapeAwards; // Should we scrape the award information
private boolean scrapeWonAwards;// Should we scrape the won awards only
private boolean scrapeBusiness; // Should we scrape the business information
private boolean scrapeTrivia; // Shoulw we scrape the trivia information
// Literals
private static final String HTML_H5_END = ":";
private static final String HTML_H5_START = "";
private static final String HTML_DIV = "