1.1.1 - Updated User-Agent, send referrer in reddit rips

Attempt to fix #155
This commit is contained in:
4pr0n 2015-01-13 00:39:52 -08:00
parent 8bb9a8d1c0
commit 3c096add20
5 changed files with 7 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<groupId>com.rarchives.ripme</groupId>
<artifactId>ripme</artifactId>
<packaging>jar</packaging>
<version>1.1.0</version>
<version>1.1.1</version>
<name>ripme</name>
<url>http://rip.rarchives.com</url>
<properties>

View File

@ -28,7 +28,7 @@ public abstract class AbstractRipper
protected static final Logger logger = Logger.getLogger(AbstractRipper.class);
public static final String USER_AGENT =
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:29.0) Gecko/20100101 Firefox/29.0";
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:34.0) Gecko/20100101 Firefox/34.0";
protected URL url;
protected File workingDir;

View File

@ -99,7 +99,9 @@ public class DownloadFileThread extends Thread {
huc.setInstanceFollowRedirects(true);
huc.setConnectTimeout(TIMEOUT);
huc.setRequestProperty("accept", "*/*");
huc.setRequestProperty("Referer", referrer); // Sic
if (!referrer.equals("")) {
huc.setRequestProperty("Referer", referrer); // Sic
}
huc.setRequestProperty("User-agent", AbstractRipper.USER_AGENT);
String cookie = "";
for (String key : cookies.keySet()) {

View File

@ -195,7 +195,7 @@ public class RedditRipper extends AlbumRipper {
List<URL> urls = RipUtils.getFilesFromURL(originalURL);
if (urls.size() == 1) {
addURLToDownload(urls.get(0), id + "-");
addURLToDownload(urls.get(0), id + "-", "", theUrl, null);
} else if (urls.size() > 1) {
for (int i = 0; i < urls.size(); i++) {
String prefix = id + "-";

View File

@ -21,7 +21,7 @@ import com.rarchives.ripme.utils.Utils;
public class UpdateUtils {
private static final Logger logger = Logger.getLogger(UpdateUtils.class);
private static final String DEFAULT_VERSION = "1.1.0";
private static final String DEFAULT_VERSION = "1.1.1";
private static final String updateJsonURL = "http://rarchives.com/ripme.json";
private static final String updateJarURL = "http://rarchives.com/ripme.jar";
private static final String mainFileName = "ripme.jar";