|
Batch Metadata Tools This forums is for discussing the user-created Batch Metadata Tools for SageTV. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
BMT Issue downloading images for TVDB
Hi,
I noticed over the last few days the BMT was having issues downloading images for new shows. After a few hours of banging my head I decided to look into the code to try and debug the issue. It looks like TVDB is forcing HTTPS connections, and BMT is trying to pull images using HTTP connections. The java HttpURLConnection does not support following redirects from HTTP to HTTPS. I am not sure if there is an easier way to fix that issue, but I made the following code change after googling the issue for a while. Hopefully I will save someone the same agrevation I just went through looking into this issue. Of course I assumed I broke something! sagex.phoenix.util.url.UrlUtil Code:
public static URLConnection openUrlConnection(URL url, String userAgent, String referrer, int timeout, boolean followRedirects) throws IOException, SocketTimeoutException { UrlConfiguration cfg = GroupProxy.get(UrlConfiguration.class); URLConnection conn = url.openConnection(); if (conn instanceof HttpURLConnection) { if (userAgent == null) { userAgent = cfg.getHttpUserAgent(); } if (userAgent != null) { conn.setRequestProperty("User-Agent", userAgent); } if (referrer != null) { conn.setRequestProperty("REFERER", referrer); } //((HttpURLConnection) conn).setInstanceFollowRedirects(followRedirects); if(((HttpURLConnection)conn).getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP || ((HttpURLConnection)conn).getResponseCode() == HttpURLConnection.HTTP_MOVED_PERM ) { URL resourceUrl, base, next; String location; location = conn.getHeaderField("Location"); location = URLDecoder.decode(location, "UTF-8"); base = new URL(url.toExternalForm()); next = new URL(base, location); return openUrlConnection(next,userAgent, referrer, timeout, followRedirects); } } if (timeout <= 0) { timeout = cfg.getReadTimeoutMS(); } if (timeout > 0) { conn.setReadTimeout(timeout); conn.setConnectTimeout(timeout); } return conn; } |
#2
|
||||
|
||||
That is the fix. It was also talked here, as well.
Now I just need to find the time to update Phoenix (you could send a pull request)
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#3
|
||||
|
||||
Quote:
Thanks, Josh |
#4
|
||||
|
||||
Awesome... I will push out a new phoenix before the end of the weekend... promise
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#5
|
|||
|
|||
EXCELLENT NEWS!!!!
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page |
#6
|
|||
|
|||
new update worked for me. Had to upgrade from sage 9.1.5 to newer version due to new gemstone prereq. but all worked well. Thank you !!
Last edited by nateziemann; 10-01-2017 at 04:08 PM. Reason: Added result |
#7
|
|||
|
|||
Quote:
Thanks all.
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page |
#8
|
|||
|
|||
Another perfect fix, thanks team! This reminds me of the "old days" - you guys are as good, if not better () than the OEM Sage crew!!!
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to Get Metadata -- tvdb instafails | aedgington | Batch Metadata Tools | 2 | 08-20-2012 10:05 AM |
Is BMT striking out with TVDB more often? | Spectrum | Batch Metadata Tools | 2 | 04-02-2011 06:57 PM |
tvdb and Camelot | jusjoken | Batch Metadata Tools | 2 | 04-02-2011 12:02 PM |
BMT fails to fetch tvdb metadata | scanner95 | Batch Metadata Tools | 1 | 02-15-2011 08:35 AM |
Issue Downloading Netflix Plugin | cgreenle | SageTV Customizations | 1 | 04-13-2008 06:23 PM |