TiVo Community Forum banner
901 - 920 of 941 Posts

·
Cranky old novice
Joined
·
9,468 Posts
Discussion Starter · #901 · (Edited)
Test version 4.04T1 can get RPC domain token from KMTTG installation (config.ini).

One Drive download link: MG404T1.zip EDIT: This link is dead now. Replaced by later
version linked in post #907.


There is a button for this just under the entry box for the Domain Token on the Mind RPC configuration screen.

Initially looks for config.ini in the default KMTTG install folder: c:\kmttg
If not found there offers to let you browse for it.
Also calculates expiration date based on value in KMTTG config file and pops up a message about that when it finds the token.

It's a test version .........:) Please provide details for any errors or problems!

OK to co-exist with Ver. 4.03 (in separated install folders). Config files are the same and will be shared with both versions. Best to run only one at a time.
 

·
Premium Member
Joined
·
443 Posts
Tested version 4.04T1 and it works great!

One nit: For those of us that keep kmttg in a non-standard location, can you have MG3 remember the location of the folder? Otherwise, I would need to browse for the folder every time I need to update my token.
 

·
Cranky old novice
Joined
·
9,468 Posts
Discussion Starter · #905 ·
That was fast! You the Man.... Working great. I like knowing when the token expires, nice.
Thank you for all your hard work.
I’d be interested in how my expiration date compares to the one in the KMTTG UI. Some assumptions and time/date conversion was required because the value in the KMTTG config file is given in milliseconds since 1/1/1970 — I think.
Tested version 4.04T1 and it works great!

One nit: For those of us that keep kmttg in a non-standard location, can you have MG3 remember the location of the folder? Otherwise, I would need to browse for the folder every time I need to update my token.
Yep I’ll incorporate that in the next release version after waiting a while to see what other issues may arise with the test version. I rushed this test version out since I don’t run KMTTG and wanted to get feedback before going too far.
 

·
Cranky old novice
Joined
·
9,468 Posts
Discussion Starter · #907 ·
Please replace test ver. 4.04T1 with test ver. 4.04T4 from this OneDrive link:

Changes relative to 4.04T1 are:
Ver. 4.04T4 (8 July 2022)
Enhanced: Remembers KMTTG folder path
Enhanced: Displays Domain Token expire date, if obtained from KMTTG config file.
Fixed: Domain Token from KMTTG config file could be correupted if it contained an '=' character

Note the fix -- a Domain Token taken from KMTTG will be truncated if it contains an '=' character, if using Ver.. 4.04T1.
 

·
Cranky old novice
Joined
·
9,468 Posts
Discussion Starter · #908 ·
TMDb had a bug in their API today, which provided bogus names for series episodes. They say the error has been fixed, but caching could mean it could be 8 hours before correct results are returned. I just tried a series that I know I had not searched for days and it still returned bad results. Bogus name for example might be "season 1" for all episodes in season 1. Or just "season".
 

·
Registered
Joined
·
93 Posts
@dlfl hopefully this helps making the domain token code native. There is not really any error handling but a invalid password should throw an exception of some sort.

Consider the code MIT licensed. I do use one external library(Newtonsoft.Json).

Below is a compiled version
 

·
Cranky old novice
Joined
·
9,468 Posts
Discussion Starter · #911 ·
Thanks to @lart2150 mg3 can now fetch RPC Domain Token Cookies directly.

Try test ver. 4.04T5 from this OneDrive link:

You now have to enter your TiVo user name (email) and password on the Mind RPC setup panel. Messages for invalid user name and password will pop up. If the direct fetch fails it will still try getting it from the KMTTG config file as in the previous test version. Or you can still get it via a browser and enter it manually.

@lart2150 I'm not sure what conditions the MIT license imposes on this project. The program and my support are free to everyone. I was on the verge of trying to port your Java code to C#. I'm sure you saved me hours and hours of work!
I already was using NewtonSoft.JSON in mg3 BTW.
 

·
Registered
Joined
·
93 Posts
@lart2150 I'm not sure what conditions the MIT license imposes on this project. The program and my support are free to everyone. I was on the verge of trying to port your Java code to C#. I'm sure you saved me hours and hours of work!
MIT is very flexible and can be used for almost any project (closed source or most open source projects). KMTTG on the other hand is gpl v2 would require metagenerator to have a gpl v2 compatible license.
 

·
Cranky old novice
Joined
·
9,468 Posts
Discussion Starter · #913 ·
@lart2150
Wonder if you can provide any insight on this behavior in the domain token code:

I've been testing it with various invalid usernames and passwords. One case is I just append an 'X' to the username, e.g., [email protected]

This is caught by some JSON parsing code that I added and is handled. However, when I revert back to the valid username (without the appended 'X') the code throws an exception because the regex match for the SAML Request finds zero matches. Shutting down the program is required to clear this. Otherwise it just repeats the issue each time you try.

It smells like some kind of proxy buffering or similar that doesn't clear the first error in web request land. Any ideas?

BTW I haven't actually run your compiled version. I took the c# code into the MG3 solution (with a few modifications).
 

·
Registered
Joined
·
93 Posts
It smells like some kind of proxy buffering or similar that doesn't clear the first error in web request land. Any ideas?
that does sound like a cache issue. I wonder if something like this would help.
Code:
    HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
    HttpWebRequest.DefaultCachePolicy = policy;
 

·
Cranky old novice
Joined
·
9,468 Posts
Discussion Starter · #916 · (Edited)
that does sound like a cache issue. I wonder if something like this would help.
Code:
    HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
    HttpWebRequest.DefaultCachePolicy = policy;
I tried that on both the reqest and post functions but it didn't help. Also tried keepAlive = false, but that made things worse. Its interesting that the problem occurs on the very first webRequest to the loginUrl. The TiVo credentials aren't even used at that point so it suggests it's not actually a problem with them, rather the downstream of a prior attempt with invalid credentials.

And the plot thickens. If you successfully fetch a token with valid credentials and then just try to repeat that, the same error occurs. I wonder if it thinks you're still logged in so doesn't provide the "Sign In" link which I assume the code is looking for. If that's the case there must something about having to break a session, which shutting down the program does. (?). It could be that there is a timeout after which the session state would reset.(?0

EDIT:
Think I fixed it. Had to do with the cookieContainer. I put your code in a static class and the CC was created just once at program start, so it was not cleared between calls to get the token. I moved the CC creation to the start of the getDomainTokenCookie function and that seems to have fixed it, (pending more testing). This was an error introduced by my integration into MG3, not a problem with your code.
 

·
Cranky old novice
Joined
·
9,468 Posts
Discussion Starter · #919 ·
Ver. 4.04 released. Download link is in first post.
Ver. 4.04 (20 July 2022)
Enhanced: Can fetch domain token needed for RPC searches directly from Tivo.com or from KMTTG config file.

A help button explaining details of the domain token fetching was added to the Mind RPC setup panel.. Also see domainToken.txt attached to first post and included in the distribution.

Again thanks to @lart2150 for the code that does the domain token direct fetch.
 

·
Registered
Joined
·
8 Posts
I'm a big fan and long-time user of Metagenerator. Many thanks to all who developed and maintain this! Also, I apologize if this problem has been asked and answered, but I didn't find it via searches.

Recently I started to get the dredded "Unexpected Problem (C501)" error after transfer of a downloaded video file to my Tivo Bolt running the old UI. I traced it down to an apparent change in the format of the tvRating field in the ".txt" file created by the Metagenerator tool (using 'theTVDB'). It used to be strings like "TV-MA" or "TV-14" but now I'm seeing large numeric values in that field that seem to break Tivo. The simple fix is to either delete that field or edit it to one of the old string values and Tivo is happy again.

Any idea what's going on, and more importantly, is there a fix available other than my having to manually edit the meta file after generation? I have no need for that field, so an option to just not populate it would be fine with me.

Thanks for any help with this!
 
901 - 920 of 941 Posts
Top