Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Next

## Version 9.2.10 (2025-04-04)
* SD EPG changes to correct Error 6000, 4009 and some other login issues with SD

## Version 9.2.9 (2025-03-11)
* Updated gradle script so that project could build in Netbeans
* Updated the FFMPEGTranscoder to fallback to frame count instead of time to calculate progress
Expand Down
3 changes: 3 additions & 0 deletions java/sage/EPG.java
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,9 @@ public void run()
}
}
if(Sage.getBoolean("sdepg_core/bypassEPGUpdates", false)){
if(minWait==0){
minWait = MAINTENANCE_FREQ; //wait 24 hours to check again as the user disabled the updates
}
if (Sage.DBG) System.out.println("SD EPG Updates are disabled by sdepg_core/bypassEPGUpdates setting. Check again in " + (minWait/60000) + " minutes");
if (minWait > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion java/sage/SageConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ private SageConstants()
// Non-instantiable
}

public static final int BUILD_VERSION = 1056;
public static final int BUILD_VERSION = 1037;
}
2 changes: 1 addition & 1 deletion java/sage/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Version
{
public static final byte MAJOR_VERSION = 9;
public static final byte MINOR_VERSION = 2;
public static final byte MICRO_VERSION = 9;
public static final byte MICRO_VERSION = 10;

public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + MICRO_VERSION + "." + SageConstants.BUILD_VERSION;

Expand Down
21 changes: 15 additions & 6 deletions java/sage/epg/sd/SDRipper.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static sage.epg.sd.SDErrors.ACCOUNT_DISABLED;
Expand Down Expand Up @@ -1775,7 +1773,7 @@ else if (chanDownloadComplete && prevChans.length == 1 && prevChans[0].equals(""
break;
}
}

// We have to do >= 500 programs because we could be anywhere from 500 to ~600. The
// limit is 5000 and a typical request is a little over 500 combined between several
// stations, so this should never be a problem. The most I have ever seen added for
Expand Down Expand Up @@ -1820,9 +1818,17 @@ else if (chanDownloadComplete && prevChans.length == 1 && prevChans[0].equals(""
String removeSeries = SDUtils.getSeriesForEpisode(extID);
if (removeSeries != null) needSeriesDetails.remove(removeSeries);
}

if (programDetail.getCode() == 6000){
if (Sage.DBG) System.out.println("SDEPG 6000 ERROR: skipping id:" + programDetail.getProgramID());
// Ensure we don't try to create an airing for this program.
noProgramDetails.add(programDetail.getProgramID());
continue;
}

if (schedule.getCode() != 0)
if (programDetail.getCode() != 0)
{
if (Sage.DBG) System.out.println("SDEPG NON ZERO ERROR " + programDetail.getProgramID() + " Error code:" + programDetail.getCode());
// Ensure we don't try to create an airing for this program.
noProgramDetails.add(programDetail.getProgramID());
continue;
Expand Down Expand Up @@ -2565,6 +2571,9 @@ public void run()
break;
case TOO_MANY_LOGINS:
sage.msg.MsgManager.postMessage(sage.msg.SystemMessage.createSDTooManyLoginsMsg());
// Set this to an hour so we aren't too obnoxious about the authentication error messages
// and so we shouldn't accidentally lock the account out.
SDRipper.retryWait = Sage.time() + Sage.MILLIS_PER_HR;
resetToken();
break;
}
Expand Down Expand Up @@ -3071,12 +3080,12 @@ private static void resetToken(){
} catch (SDException ex) {
if (Sage.DBG)
{
System.out.println("SDEPG invalid SD authentication - token reset so next call will get a new token");
System.out.println("SDEPG SDException. Invalid SD authentication - token reset so next call will get a new token: " + ex.getMessage());
}
} catch (IOException ex) {
if (Sage.DBG)
{
System.out.println("SDEPG invalid SD authentication - token reset so next call will get a new token");
System.out.println("SDEPG IOException. Invalid SD authentication - token reset so next call will get a new token: " + ex.getMessage());
}
}

Expand Down
16 changes: 16 additions & 0 deletions java/sage/epg/sd/SDSageSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ private InputStreamReader post(URL url, byte sendBytes[], int off, int len, bool
// because another program is using the same account, so we try once to get the token back.
if (retry && connection.getResponseCode() == 403)
{
if (SDSession.debugEnabled())
{
SDSession.writeDebugLine("POST response 403 received. Skipping retry.");
}
//2025-03-28 jusjoken remove the retry as it used to be needed for expired tokens but since we get
// a new token if expired then this just causes an infinite loop of 403 errors
/*
token = null;
if (SDSession.debugEnabled())
{
Expand All @@ -179,6 +186,7 @@ private InputStreamReader post(URL url, byte sendBytes[], int off, int len, bool
SDSession.writeDebugLine("POST retry after authenticate call. token = '" + token + "'");
}
return post(url, sendBytes, off, len, false);
*/
}

// We can timeout just getting the InputStream.
Expand Down Expand Up @@ -229,6 +237,13 @@ private InputStreamReader get(URL url, boolean retry) throws IOException, SDExce
// because another program is using the same account, so we try once to get the token back.
if (retry && connection.getResponseCode() == 403)
{
if (SDSession.debugEnabled())
{
SDSession.writeDebugLine("GET response 403 received. Skipping retry.");
}
//2025-03-28 jusjoken remove the retry as it used to be needed for expired tokens but since we get
// a new token if expired then this just causes an infinite loop of 403 errors
/*
token = null;
if (SDSession.debugEnabled())
{
Expand All @@ -250,6 +265,7 @@ private InputStreamReader get(URL url, boolean retry) throws IOException, SDExce
SDSession.writeDebugLine("GET retry after authenticate call. token = '" + token + "'");
}
return get(url, false);
*/
}

try
Expand Down
24 changes: 22 additions & 2 deletions java/sage/epg/sd/SDUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,13 @@ else if (errorPresent403){
if (SDSession.debugEnabled())
{
SDSession.writeDebugLine("HTTP 403 received. Processing");
SDSession.writeDebugLine("HTTP 403 Disabling debug_sd_support. Process will restart");
if(Sage.getBoolean("debug_sd_support", false)){
SDSession.writeDebugLine("HTTP 403 Disabling debug_sd_support. Process will restart");
Sage.putBoolean("debug_sd_support", false);
}
}
}
if(Sage.getBoolean("debug_sd_support", false)){
Sage.putBoolean("debug_sd_support", false);
}

//stop processing
Expand Down Expand Up @@ -169,6 +172,23 @@ else if (errorPresent403){
{
JsonElement codeElement = ((JsonObject) errorElement).get("code");
int code = codeElement != null ? codeElement.getAsInt() : -1;

if (code==2055){
if (SDSession.debugEnabled())
{
SDSession.writeDebugLine("HTTP 400 received with ERROR 2055. Disabling debug_sd_support. Process will restart");
}
if(Sage.getBoolean("debug_sd_support", false)){
Sage.putBoolean("debug_sd_support", false);
}
}else if (code==4009){
if (SDSession.debugEnabled())
{
SDSession.writeDebugLine("HTTP 400 received with ERROR 4009. Process will restart");
//NEED TO ADD A WAIT

}
}

SDErrors.throwErrorForCode(code);
}
Expand Down