Browse Source

Fix loading of some RSS feeds that require a User-Agent to be set, such as RARBG. Fixes #374.

pull/406/head
Eric Kok 7 years ago
parent
commit
907b6937ca
  1. 4
      app/src/main/java/org/transdroid/core/rssparser/RssParser.java

4
app/src/main/java/org/transdroid/core/rssparser/RssParser.java

@ -17,6 +17,7 @@ import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; @@ -17,6 +17,7 @@ import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;
import org.transdroid.daemon.util.HttpHelper;
import org.transdroid.daemon.util.TlsSniSocketFactory;
import org.xml.sax.Attributes;
@ -137,6 +138,7 @@ public class RssParser extends DefaultHandler { @@ -137,6 +138,7 @@ public class RssParser extends DefaultHandler {
HttpParams httpparams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpparams, 5000);
HttpConnectionParams.setSoTimeout(httpparams, 5000);
HttpProtocolParams.setUserAgent(httpparams, HttpHelper.userAgent);
DefaultHttpClient httpclient = new DefaultHttpClient(new ThreadSafeClientConnManager(httpparams, registry),
httpparams);
@ -292,4 +294,4 @@ public class RssParser extends DefaultHandler { @@ -292,4 +294,4 @@ public class RssParser extends DefaultHandler {
this.text.append(ch, start, length);
}
}
}

Loading…
Cancel
Save