|
| Author |
Message |
orangeboy
Joined: 14 Sep 2009 Posts: 74
|
Posted: Wed May 05, 2010 8:56 pm Post subject: PyTivo on a second "batch" port? |
|
|
I use cURL (via batch) quite a bit to send my requests to pyTivo. pyTivo sends back the acknowledgement in html, and whenever I briefly see it, it makes me think some type of error has occurred! The batch I use is strictly Windows command line crap, so it runs in a command prompt window where html isn't very pretty. Would it be possible to have pyTivo open a second "batch" port that returns plain text? No big deal if not, since I don't see 95% of the transactions happening anyway!
Thanks for any thoughts in this matter... |
|
| Back to top |
|
 |
gonzotek
Joined: 12 Jan 2008 Posts: 64
|
Posted: Thu May 06, 2010 3:24 am Post subject: Re: PyTivo on a second "batch" port? |
|
|
| orangeboy wrote: | I use cURL (via batch) quite a bit to send my requests to pyTivo. pyTivo sends back the acknowledgement in html, and whenever I briefly see it, it makes me think some type of error has occurred! The batch I use is strictly Windows command line crap, so it runs in a command prompt window where html isn't very pretty. Would it be possible to have pyTivo open a second "batch" port that returns plain text? No big deal if not, since I don't see 95% of the transactions happening anyway!
Thanks for any thoughts in this matter... | Can you redirect the curl output to a temp file? _________________ Follow @pytivo on Twitter for project updates and more! http://twitter.com/pytivo |
|
| Back to top |
|
 |
philhu
Joined: 04 Jan 2008 Posts: 474
|
Posted: Thu May 06, 2010 1:47 pm Post subject: |
|
|
No, he means a standard reader useable acknoledgement.
The output is very techie.
When you send a file or anything to pytivo, have it output on a different window/channel/whatever something like:
Command successful, file xxx.xxx - transfer initiaited
Command failed, 'No room on device'
Things like that. I guess since he is doing batch though, he could parse for the good or bad outputs. |
|
| Back to top |
|
 |
gonzotek
Joined: 12 Jan 2008 Posts: 64
|
Posted: Thu May 06, 2010 2:53 pm Post subject: |
|
|
I don't think there is 'a no room on device' type of response. A push request tells pytivo to connect to the tivo servers in the cloud and tell them where a file is and where (which tivo) it is going. The mind servers are then contacted periodically by a tivo unit to see if there are any new requests. So the batch file and pytivo don't have any opportunity to learn if there is room on the device. Basically, the push either gets queued or it doesn't (because of bad user/pass combo, incorrect mind server, or errors on Tivo's end).
But redirection and then parsing was what I was getting at. It shouldn't be too hard to parse out the correct 'queued' response and just echo either a Queuing Successful message or Queuing Error message on any other condition. Maybe optionally open the temp file in a browser to see the complete error message pytivo gave. _________________ Follow @pytivo on Twitter for project updates and more! http://twitter.com/pytivo |
|
| Back to top |
|
 |
orangeboy
Joined: 14 Sep 2009 Posts: 74
|
Posted: Thu May 06, 2010 5:47 pm Post subject: |
|
|
I believe the message typically displayed is similar to what is generated from \plugins\video\video.py:
| Code: | logger.info('[%s] Queued "%s" for Push to %s' %
(time.strftime('%d/%b/%Y %H:%M:%S'),
unicode(file_path, 'utf-8'), tivo_name))
|
Since it is "logger.info", I believe that message is only going to debug.log, and is not the html that is being produced.
But yes, redirecting the cURL output to a results type file is a good idea. I use a some UNC paths in pytivo.conf, so depending on whether I'm initiating the push (via batch) from "local" (F:\My Videos) or "remote" (\\MyPC\My Videos) does occasionally give me grief if I'm not paying attention. Having a (plain text) readable results file would/should help remind me to navigate to the correct folder before pushing! |
|
| Back to top |
|
 |
lrhorer
Joined: 04 Mar 2008 Posts: 153
|
Posted: Sun Sep 12, 2010 6:27 am Post subject: |
|
|
| In this thread I asked for the same feature. What say, William? Any chance of a flat text or other machine oriented port for pyTiVo? I suppose I could open a socket directly on the TiVo server. Tivochat1.tivo.com:5223, is it? |
|
| Back to top |
|
 |
|