1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PyTivo Video Manager HME App for pyhme

Discussion in 'Developers Corner' started by jbernardis, Apr 20, 2011.

  1. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    SO I guess there's nothing to do with this filename except manually change it like the original poster did. I should also probably put a try block around the unicode call. All of this begs the question, then, about the OP saying this file worked for him in pytivo. How did pytivo handle it if the filename violates the TiVo specs?
     
  2. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    What? No, no, no. Either read it with a Unicode call -- in Python, you do this by passing a Unicode path to os.listdir(), for example -- or else recognize the 8-bit character set that's being used, or just assume it, and convert appropriately.
     
  3. dcrowell77

    dcrowell77 New Member

    50
    0
    Dec 27, 2007
    I grabbed the console output from pytivo during the attempt that worked but indicated a failure. I didn't notice any messages using the web interface.


    Code:
    DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec mpeg2video not compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec mpeg2video not compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.video:Pushing http://192.168.1.7:9032/TV%20Shows/Burn%20Notice/Burn%20Notice%20-%20205%20-%20Scatter%20Point.mpg
    DEBUG:pyTivo.mind:__login
    {'cams_security_domain': 'tivocom', 'cams_login_config': 'http', 'cams_cb_password': 'd4a1n14c', 'cams_original_url': '/mind/mind7?type=infoGet', 'cams_cb_username': 'daniel.crowell@gmail.com'}
    DEBUG:pyTivo.mind:pcBodySearch
    {}
    
    <pcBodyList><isBottom>true</isBottom><isTop>true</isTop><pcBody><bucketNumber>-1</bucketNumber><levelOfDetail>low</levelOfDetail><name>pyTivo</name><pcBodyId>tivo:pc.1001335731</pcBodyId><type>pcBody</type></pcBody></pcBodyList>g
    DEBUG:pyTivo.mind:pcBodySearch
    {}
    
    <pcBodyList><isBottom>true</isBottom><isTop>true</isTop><pcBody><bucketNumber>-1</bucketNumber><levelOfDetail>low</levelOfDetail><name>pyTivo</name><pcBodyId>tivo:pc.1001335731</pcBodyId><type>pcBody</type></pcBody></pcBodyList>g
    DEBUG:pyTivo.mind:bodyOfferModify&bodyId=tsn:65200018042EBC4
    {'description': '', 'title': 'Burn Notice - 205 - Scatter Point', 'url': 'http://192.168.1.7:9032/TV%20Shows/Burn%20Notice/Burn%20Notice%20-%20205%20-%20Scatter%20Point.mpg?Format=video/mpeg', 'pcBodyId': 'tivo:pc.1001335731', 'bodyId': 'tsn:65200018042EBC4', 'publishDate': '2011-05-31 03:1241', 'source': 'SH924844', 'state': 'complete', 'partnerId': 'tivo:pt.3187', 'duration': 3595, 'encodingType': 'mpeg2ProgramStream', 'size': 1783300643}
    
    <bodyOffer><bodyId>tsn:65200018042EBC4</bodyId><bodyOfferId>tivo:bo.15028161</bodyOfferId><createDate>2011-05-31 03:12:39</createDate><description /><duration>3595</duration><encodingType>mpeg2ProgramStream</encodingType><levelOfDetail>high</levelOfDetail><offerId>tivo:of.bs.15028161</offerId><partnerId>tivo:pt.3187</partnerId><pcBodyId>tivo:pc.1001335731</pcBodyId><publishDate>2011-05-31 23:41:00</publishDate><size>1783300643</size><source>SH924844</source><state>complete</state><title>Burn Notice - 205 - Scatter Point</title><updateDate>2011-05-31 03:12:39</updateDate><url>http://192.168.1.7:9032/TV%20Shows/Burn%20Notice/Burn%20Notice%20-%20205%20-%20Scatter%20Point.mpg?Format=video/mpeg</url></bodyOffer>g
    DEBUG:pyTivo.mind:subscribe&bodyId=tsn:65200018042EBC4
    {'uiType': 'cds', 'idSetSource': {'contentId': 'tivo:ct.bs.15028161', 'type': 'singleOfferSource', 'offerId': 'tivo:of.bs.15028161'}, 'bodyId': 'tsn:65200018042EBC4', 'title': 'pcBodySubscription'}
    
    <subscribeResult><subscription><autoRecord>true</autoRecord><bodyGeneratesCandidates>false</bodyGeneratesCandidates><bodyId>tsn:65200018042EBC4</bodyId><hdOnly>false</hdOnly><idSetSource><contentId>tivo:ct.bs.15028161</contentId><offerId>tivo:of.bs.15028161</offerId><type>singleOfferSource</type></idSetSource><isAdult>false</isAdult><isForKids>false</isForKids><levelOfDetail>high</levelOfDetail><showStatus>rerunsAllowed</showStatus><subscriptionId>tivo:sb.15028531</subscriptionId><title>pcBodySubscription</title><type>subscription</type><uiType>cds</uiType></subscription></subscribeResult>g
    INFO:pyTivo:192.168.1.7 [30/May/2011 22:12:43] "POST /TivoConnect HTTP/1.0" 302
    -
    INFO:pyTivo:192.168.1.7 [30/May/2011 22:12:43] "GET /None HTTP/1.0" 200 -
    DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
    INFO:pyTivo:192.168.1.4 [30/May/2011 22:13:08] "GET /TV%20Shows/Burn%20Notice/Burn%20Notice%20-%20205%20-%20Scatter%20Point.mpg?Format=video%2Fmpeg HTTP/1.1" 206 -
    DEBUG:pyTivo.video.video:V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg is tivo compatible
     
  4. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Here are the relevant lines from my pytivo log when I do a push.
    Code:
    2011-05-30 21:47:50,014 INFO  pyTivo.video.video: [30/May/2011 21:47:50] Queued "/media/Videos/Movies/Family/Disney/Shorts/Day and Night.mp4" for Push to Master Bedroom
    2011-05-30 21:47:50,015 INFO  pyTivo: 192.168.1.124 [30/May/2011 21:47:50] "POST /TiVoConnect HTTP/1.1" 200 -
    
    Note 2 things: 1) there is a very definite Queued message in my log. I'm not sure why it's not in yours, and 2) My POST response is 200 which indicates success. Yours is 302 which means "Moved Temporarily". I'm not sure why yours gets the 302, but one question I'd have to ask is how recent your pytivo is? Maybe it's time to update it? Just a suggestion.

    If I don't see a response from pytivo, I have to pretty much assume a failure. I guess I could go by the HTTP return code instead of the message, but I'm not sure if a 302 is a valid return code in this case. Can anybody offer an opinion here?
     
  5. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    Yeah, pyTivo doesn't use 302 currently, but it used to. This was changed in Feb. 2010.
     
  6. Jun 1, 2011 #126 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I posted version 0.3a of the app on git. This addresses some of the issues reported here. The clear key no longer directly exits the app. That was actually an early debugging aid when I was testing deeply nested directories - I wanted a quick way out, and I just forgot to remove it.
    Also, the advance key now takes you back to the beginning of a list if you're positioned at the end. Otherwise, it takes you to the end.
    Also, I removed the calls to unicode from metadata.py. These are not filenames I am trying to send to the tivo - they are file names I am attempting to open locally in order to read the meta data out of them. I felt there was no need to process the file names as such. I'm sure if this causes issues we'll all hear about it here.

    I have no additional information for how to proceed with the 302/200 HTTP return code and the missing queued message other than to advise people to update their pytivo installation. Also, someone wanted some kind of a "please wait" type of thing if the requested operation was going to be lengthy. I'm not saying no to that, but it's low on the to do list.
     
  7. Jun 1, 2011 #127 of 735
    reneg

    reneg Member

    699
    0
    Jun 19, 2002
    No new issues here. Works great, thanks for the changes!
     
  8. Jun 2, 2011 #128 of 735
    dcrowell77

    dcrowell77 New Member

    50
    0
    Dec 27, 2007
    I made an update and things are working better now. I do see the positive message and I haven't gotten an error.

    Thanks!
     
  9. Jun 3, 2011 #129 of 735
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    OK. The other thing that hit me was the lack of a listing of the number of videos in a directory. PyTivo and Galleon both do this, and I like it.
     
  10. Jun 3, 2011 #130 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I'm at work just thinking about this one. I kind of like that idea too. Does it just show videos, and not subdirectories? Does it just show the number of videos in the immediate subdirectory and not in the entire subdirectory tree?

    I could probably do videos in the immediate directory easily enough, but I wouldn't want to do the entire tree, not because it's tough, but because it could be expensive in terms of processing time. Would this suffice?
     
  11. Jun 3, 2011 #131 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Version 0.3b is now on git. A few changes:

    1) I added a "please wait" graphic for long running operations - currently this includes pushing a video, deleting a video, and building a directory listing. The latter is not really necessary, but if your directories are large and have thumbnails, they could take a few seconds.
    2) I added a file and directory count to directory and share names where they appear on the screen. (These two items at lrhorer's request)
    3) I have provided an alternate set of graphics. They are in the skins/blue directory. Just drop all of the png files into the vidmgr directory if you want to try it out. The background is just a simple blue color with a gradient fill of a lighter blue. It's much cleaner and I like it. I was never in love with the original purple screens, but didn't want to spend too much time on that aspect of the app.
    4) Because of the alternate skin, I have changed the color of the font used for description text from black to white. I think this too looks better

    Happy pushing :)
     
  12. Jun 4, 2011 #132 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Sorry everyone

    There were a couple of bugs in the last delivery, prompting me to deliver 0.3c. This fixes:
    1) exception when navigating OUT of an empty directory
    2) video count was not updating in the shares list when a video was deleted
    3) minor glitch when processing display option in the config file
     
  13. Jun 4, 2011 #133 of 735
    jcthorne

    jcthorne Active Member

    2,726
    3
    Jan 28, 2002
    Houston
    Wow, really on a roll with this. Love the updates! Working very well. Thanks!

    I have a request to consider. Would it be possible to append the starRating, movieYear, and the first 2 or 3 vActor tags (from the metadata) to the discription or display them in some other way. Perhaps to the right of the cover art in the HD view? Just looking for a way to get just a bit more info presented.

    Thanks again for a very useful bit of software.
     
  14. Jun 4, 2011 #134 of 735
    reneg

    reneg Member

    699
    0
    Jun 19, 2002
    Latest update is nice. I'll throw a couple requests out there too:
    1) Support the info button and display the metadata kind of like how Tivo supports it on individual items.
    2) Increase HD lists from 12 rows to 13 rows (not sure 14 rows would fit).
     
  15. Jun 4, 2011 #135 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Ok - let's see

    Reneg's request number 2 is trivial - I can see how many lines I can fit and increase it to that.

    Reneg's other request kind of works hand in hand with jcthorne's request. There really is not too much space left on the screen - the area to the right of the thumbnail is where I have the push/delete menu and the menu if you have multiple tivo's. But perhaps the info button could bring up some sort of pop-up where I could put more complete metadata information.

    Let me think about it for a few days.
     
  16. Jun 5, 2011 #136 of 735
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    Thanks! 'No thumbnails - at least not yet, but many of my shares have more than 1000 videos in them. Under the old code I could never really be certain whether the button press was lost, or not.

    Yep, and thanks a ton! I'll have to try this out, perhaps tonight if I get a chance.

    Yeah, me, either. I had real trouble reading the screen, especially in the livingroom, which is often sunlit. I just created a simple two tone gray HD background shown below for my own use. I'll try yours out and see how I like it. If anyone likes it, they are free to scarf it from my website:

    [​IMG]

    http://fletchergeek.com/images/background.png
    http://fletchergeek.com/images/backgroundHD.png
    Note: I haven't tried the SD background, myself.

    Oh, cool! I agree about the font. I was going to look into this, but you beat me to it. :)
     
  17. Jun 8, 2011 #137 of 735
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    I'm not sure. Two levels is the deepest I go.

    For me it certainly would. Perhaps a better compromise, however, would be the total number of videos in the immediate subdirectory plus the number of child directories in the immediate subdirectory.
     
  18. Jun 8, 2011 #138 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    lrhorer:

    This is already in the current git. You can download it and try it today. It tells you the total number of videos PLUS the number of directories - a single sum. This is what pytivo does (at least the version I am using)

    I am just about ready to release a version that allows you to press the "info" button to see ALL of the metadata associated with a video - not just the description as it currently does. I expect to upload it by Friday of this week. The logic is relatively complete, but I was just trying to figure out if I have a complete list of meta items. I'm basically using the metadata.py module from pytivo to identify the MANY different tags.
     
  19. Jun 9, 2011 #139 of 735
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    I have 0.3c. Isn't that the latest as of this moment?

    OK, I really wouldn't notice this, since none of the folders I have created have both videos and folders in them.

    That sounds intriguing. Boy, you're really on a roll with this app!
     
  20. Jun 9, 2011 #140 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Yes - 0.3c is the version you want. Basically if you have the version that has the clock icon for long-running operations, you have the correct version since both of these capabilities were released together. If you are not seeing a count of your videos, please let me know and we can do some debugging.
     

Share This Page