NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 40 41 42 43 44 … 93 Next »
import remote recordings

 
  • 0 Vote(s) - 0 Average
import remote recordings
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#1
2007-08-17, 04:14 AM (This post was last modified: 2007-08-17, 05:21 AM by pBS.)
Wasn't sure if anyone was interested, but i've been working on a batch file to get recordings from a remote machine, without running anything on the remote..

I'm making 2 batches, one that pulls the recordings from a remote machine. Another that runs on 'source' machine in postprocessing.bat that just sends the file that was just recorded....[for automatic updates]

So far i have the one that pulls them from any other machine where you have net access to the gbpvr.db3 file.

Mostly it just makes a recording-dump.xml file and imports it into gb...
[Remember to edit the database location at top of bat and run from gbpvr\ dir]
getshows.bat:

Almost done with the other postprocessing.bat one...needs more testing..
after this i'm going to try to save/import all pending recording types in recording-dump.xml..Big Grin
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#2
2007-08-18, 12:55 PM (This post was last modified: 2008-02-14, 02:09 AM by pBS.)
Sendshow.bat:
Put in your postprocessing.bat to update another gbpvr machine with just recorded show's info automatically...

NOTE: if calling the batch from postprocessing or parallelprocessing.bat, use "cmd /c sendshow.bat %1" so you'll have network access, otherwise you'll get a 'access denied' message because it's run as system account..

Also requires sqlite3.exe in gbpvr dir

It will automatically adjust the channels to dest. system's channel list.
And it also changes the source path on remote system to be a net path.
[edit dbremote var at top to point to destination machine and net path and save]

Code:
@echo off
:: Set your GBPVR installation locations here********************
::   [New path to Recording Dir] as seen from remote,usually net path if not mapped,
::     must be available from remote****
set pathremote=\\otherPVR\g\
::change only if needed,        [Local DB Path.]
set db=C:\Program Files\devnz\gbpvr\gbpvr.db3
::                                      [Remote machine's db path.]
set dbremote=\\thisPvr\c\program files\devnz\gbpvr\gbpvr.db3
::****** DO NOT EDIT BELOW THIS LINE*********
set firstdir=
set newname=
for /f "tokens=1,2,3,4,5,6,7,8,9,10 delims=\" %%d in ("%~1") do (
    if not "%%d"=="" set firstdir=
    if not "%%e"=="" set firstdir=%%d
    if not "%%f"=="" set firstdir=%%e
    if not "%%g"=="" set firstdir=%%f
    if not "%%h"=="" set firstdir=%%g
    if not "%%i"=="" set firstdir=%%h
    if not "%%j"=="" set firstdir=%%i
    if not "%%k"=="" set firstdir=%%j
    if not "%%l"=="" set firstdir=%%k
    if not "%%m"=="" set firstdir=%%l
)
echo File Path = %firstdir%
echo new path = %pathremote%%firstdir%\%~nx1
set newname=%pathremote%%firstdir%\%~nx1


for /f "usebackq tokens=1-11 delims=+" %%a in (`sqlite3.exe -separator " +" "%db%" "SELECT filename, c.name, status, manual_start_time, manual_end_time, p.name, p.sub_title, p.description, unique_identifier, programme_oid  from RECORDING_SCHEDULE AS s inner join PROGRAMME as p on s.programme_oid = p.oid, CHANNEL as c on s.manual_channel_oid = c.oid where filename like '%%%~nx1';"`) do (
set fname=%%a
set chan=%%b
set status=%%c
set start=%%d
set end=%%e
set title=%%f
set sub=%%g
set desc=%%h
set uid=%%i
set soid=%%j
call :fixchars
)

call :fixchan
if "%soid%" == "" echo Not found in database!! && goto :eof
echo ***ch=%chan%
call :getnewoid
call :echoit >>lastsend.log
goto :export




:fixchars
set fname=%fname:&=&%
set fname=%fname:~0,-1%
set status=%status:~0,-1%
set start=%start:~0,-9%
set end=%end:~0,-9%
set title=%title:&=&%
set title=%title:~0,-1%
set sub=%sub:&=&%
set sub=%sub:~0,-1%
set desc=%desc:&=&%
set desc=%desc:'=`%
set desc=%desc:;=.%
set desc=%desc:~0,-1%
set chan=%chan:~0,-1%
goto :eof

:echoit
echo.
echo fname "%fname%"
echo chan "%chan%"
echo status "%status%"
echo start "%start%"
echo end "%end%"
echo title "%title%"
echo sub "%sub%"
echo desc "%desc%"
echo uid "%uid%"
echo org. sched. oid - %soid%
echo channel oid new system - "%newchoid%"
echo.
goto :eof

:fixchan
::adjust channel name to new channel.oid
for /f "usebackq tokens=* delims=," %%t in (`sqlite3 "%dbremote%" "SELECT oid FROM channel where name like '%%%chan%';"`) do (set newchoid=%%t)
echo ************ origial channel is %chan% newoid-%newchoid%
goto :eof

:getnewoid
for /f "usebackq tokens=1,2 delims=," %%v in (`sqlite3 "%dbremote%" "select oid from programme order by oid DESC limit 1;"`) do set oid=%%v
goto :eof

:export
set /a oid=%oid% + 1
echo new oid-%oid% %fname% %chan% >> sent.log
sqlite3 -separator "+" "%dbremote%" "INSERT or ignore INTO PROGRAMME (name,sub_title, description, start_time, end_Time, channel_oid, unique_identifier) VALUES ('%title%','%sub%','%desc%','%start%','%end%','%newchoid%','%uid%');"
sqlite3 -separator "+" "%dbremote%" "INSERT or ignore INTO "RECORDING_SCHEDULE" (oid, programme_oid, capture_source_oid, status, filename, recording_type, recording_group, manual_start_time, manual_end_time, manual_channel_oid, quality_level, pre_pad_minutes, post_pad_minutes) Values (NULL,'%oid%','0','%status%','%newname%','0','0','%start%','%end%','%newchoid%','1','0','0');"

sample postprocessing.bat:
Code:
cmd /c sendshow.bat %1>>send.log
save both in gbpvr\ dir and you're all set..Smile
Any new recordings info will automatically show up on other machine!
[not needed at all for client mode]

EDIT: enhanced channel handling adjustments, filtered "&" and blank fields..
been using for months now, no problems.
added change source path.
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
ercuem
Offline

Member

Posts: 97
Threads: 27
Joined: Jan 2006
#3
2007-08-18, 06:01 PM
I would like to send reocurring recordings to GB-PVR from a digital TV-Magazin.

The Digital TV Magazin is able to send messages like this:

"REC" "ZDF" "ZDF" "Hallo Robbie " "2007" "08" "18" "19" "25" "50" "Hallo Robbie "

is it possible to send recordings with your tool, mentioned here
Core2Duo
Asus P5B Deluxe Wifi
2 x 500MB / 800Mhz
Twinhan USB DVBT
Skystar 2 / Sattelite
DVB World / Sattelite
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#4
2007-08-21, 10:41 AM
yes, but you have to supply all the needed info..
i'm not sure which ones are totally needed but a look at recording-dump.xml is a start...

tho you'd have to mod my batch file to do so..
it gets it's input from the db,so you'd have to supply all that info..
specifically:filename, chan.name, status, manual_start_time, manual_end_time, name, sub_title, description, and unique_identifier...

pretty sure filename, status, manual times, and at least name are all mandatory..i believe channel also..
just substitute the first for-loop with %1 %2 etc from cmd line and you're all set..Smile

the programming is a bit messy but it gets the job done, had to filter the data a little bit to weed out bad chars, and ensure blank values would be returned instead of ignored...so run the call statements from that for loop..

i may just make necessary mods and post it later..would be handy to have a single file importer...was already working on it..Big Grin
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
ercuem
Offline

Member

Posts: 97
Threads: 27
Joined: Jan 2006
#5
2007-08-21, 07:41 PM (This post was last modified: 2007-08-21, 07:56 PM by ercuem.)
The following parameters can be converted by the program
//
//
// D day as number (starting time) without prominent zero (1-31).
// dd day as number (starting time) with prominently zero (01-31).
//
// m month as number (starting time) without prominent zero (1-12).
// you should use better always two m, since otherwise a misleading format is converted like e.g. 16,3.
// mm month as number (starting time) with prominently zero (01-12).
//
// yy year as number (starting time) as two digit number (00-99).
// yyyy year as number (starting time) as number four digit (0000-9999).
//
//
// h hour (starting time) without prominent zero (0-23).
// rear spar hour (starting time) with prominently zero (00-23).
//
// n minute (starting time) without prominent zero (0-59).
// nn minute (starting time) with prominently zero (00-59).
//
// q day as number (end time) without prominent zero (1-31).
// qq day as number (end time) with prominently zero (01-31).
//
// w month as number (end time) without prominent zero (1-12).
// ww month as number (end time) with prominently zero (01-12).
//
// ee year as number (end time) as two digit number (00-99).
// eeee year as number (end time) as number four digit (0000-9999).
//
// r hour (end time) without prominent zero (0-23).
// rr hour (end time) with prominently zero (00-23).
//
// f minute (end time) without prominent zero (0-59).
// FF minute (end time) with prominently zero (00-59).
//
// '' "" into half or whole quotation marks enclosed indications do not affect formatting and as are entered indicated.
// words such as DO record to over e.g. pass on directly, use you “DO record” or “DO record”
// around the indication “to represent, use you “””
// around the indication “to represent, use you “” “
// ex.: a'b " C " d'e " f'g'" => off " C " def'g'
//
// # title of the transmission in full length.
// #### titles of the transmission, fit in into the number of # indications. Longer titles are cut off.
// shorter ones are filled up with blanks up to the last # indication.
// since the version 2.30 become the special characters '()! /? &$§ " *: and; before the use
// filtered and by blanks replaces. With the use of **** (see below) those become
// blank deleted.
//
// * titles of the transmission without blanks in full length.
// **** titles of the transmission without blanks, fit in into the number * of indications. Longer titles are cut off.
// shorter ones are filled up with blanks up to the last * indication.
//
// % title of the transmission special character and blank through _ replaces, full length.
// %%%% titles of the transmission special character and blank through _ replaces, fit in into the number of % indications.
// shorter names are filled up with _ up to the latter % indications.
//
// i TVgenial transmitter number, converted according to transmitter table, see below.
//
// u TVUID: Television universal identification
// transmitter number after uniform transmitter coding, 7 digit number
// coding is under to find: http://www.ARAKON-Systems.de
// in place of the u is used the number. This coding must of the photograph program
// to be supported, the advantage lies in an absolutely clear allocation of the transmitters, that
// filling out transmitter tables of classification is not necessary any longer.
//
// s transmitter short name - uses as in TVgenial (not the linkage registered in this file)
//
// j transmission duration, as number in minutes without prominent zero (0-9999).
// k transmission duration, as number in seconds without prominent zero (0-999999).
//
// g category ID (more integer)

These are the possible parameters, i`ve translated them with google translator, i hope everything is clearly understandable, if nor i will try to support as much as i can.

Best regards
Core2Duo
Asus P5B Deluxe Wifi
2 x 500MB / 800Mhz
Twinhan USB DVBT
Skystar 2 / Sattelite
DVB World / Sattelite
ercuem
Offline

Member

Posts: 97
Threads: 27
Joined: Jan 2006
#6
2007-08-21, 07:51 PM
This is the script-text used by the digital tv magazin. First number is the channel number used by the D.TV.M, it can't be changed, ARD is the channel used by the recording programm and can be changed, channel numbers are also supported here.


StartID // bitte nicht löschen / do not remove
// 0 (unbelegt)
1 = ARD // ARD Erstes Deutsches Fernsehen
2 = ZDF // ZDF Zweites Deutsches Fernsehen
3 = RTL // RTL Radio Television Luxemburg
4 = Sat1 // Sat1 Satelitenfernsehen 1
5 = Pro 7 // Pro7 Pro 7
6 = 6 // MDR Mittel Deutscher Rundfunk
7 = 7 // WDR West Deutscher Rundfunk
8 = 8 // VOX VOX
9 = // 3sat Drittes Satelitenfernsehen
10 = // BR Bayrischer Rundfunk, Bayern 3
11 = // Kabel 1 Kabelfernsehen 1
12 = // RTL 2 Radio Television Luxemburg 2
13 = unbelegt //
14 = // ORB Ostdeutscher Rundfunk Brandenburg (Sendebetrieb eingestellt, jetzt RBB)
15 = // NBC NBC Giga / NBC Europe
16 = // arte Arte Deutschland TV
17 = // N3 Norddeutsches Fernsehen (=NDR)
18 = unbelegt //
19 = // HR Hessen Fernsehen = HR3 = Hess. Rundfunk
20 = // SFB Sender Freies Berlin (B1) (Sendebetrieb eingestellt, jetzt RBB)
21 = // * Premiere Premiere analog (Sendebetrieb eingestellt)
22 = // FAB Fernsehen Aus Berlin
23 = // TVM TV München
24 = // TVB TV Berlin


This is an Example script, it is dependent by the recording programm.
"REC" "ZDF" "ZDF" "Hallo Robbie " "2007" "08" "18" "19" "25" "50" "Hallo Robbie "

"REC" '"'i'"' '"'i'"' '"'#'"' yyyy mm dd hh nn j '"'#'"'
best regards
ercuem
Core2Duo
Asus P5B Deluxe Wifi
2 x 500MB / 800Mhz
Twinhan USB DVBT
Skystar 2 / Sattelite
DVB World / Sattelite
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#7
2007-08-21, 11:28 PM (This post was last modified: 2007-08-21, 11:35 PM by pBS.)
the batch file will have to be remade to schedule new recordings, but looks workable...just need a start time and end time and channel and title..
and looks kinda like your data can supply it..tho i'm not sure of the mechanism of delivery..

if wanting to click on a web page link to start a recording, more is needed..
But if you have a program that can run the batch file, supplying needed params, it should work..Smile

when i get something that can process a single file from command line i'll let you know...then that can be modified for your purposes..
it's going to be tricky..

so how does this work? what happens after you click on web show link?
[batch files aren't easy to run from web link...security issues]
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
ercuem
Offline

Member

Posts: 97
Threads: 27
Joined: Jan 2006
#8
2007-08-22, 08:49 AM (This post was last modified: 2007-08-22, 08:59 AM by ercuem.)
Thank you very much for reply

This is not a Web show link, it is very popular " in German speaking area" independent programm which you can install on your maschine.

You can specifify to the programm a text script, which it will handle, after you clicking the record option in the programm.
The programm is looking for the "Dorecord" and "Dodelete" text file in the Recorder script.

Here is an example
DoRecord "c:\PBS-GB-PVR-Sheduler.exe" '-add' '"'i'"' dd.mm.yyyy hh:nn j '"'#'"'
DoDelete "c:\PBS-GB-PVR-Sheduler.exe" '-del' '"'i'"' dd.mm.yyyy hh:nn

Here is a test version of the digital TV Magazin.
http://www.tvplanen.de/download/TVgenial404.exe

After installing and update of the Database go to "Optionen" - "Aufnahmen" - "script für unbekanntes gerät" - "specify your script.txt".

Now you can choose the desired "which you want to record" film, by clicking on right mouse button and choosing "Sendung aufzeichnen".

Best regards
Core2Duo
Asus P5B Deluxe Wifi
2 x 500MB / 800Mhz
Twinhan USB DVBT
Skystar 2 / Sattelite
DVB World / Sattelite
ercuem
Offline

Member

Posts: 97
Threads: 27
Joined: Jan 2006
#9
2007-08-22, 08:58 AM
I've seen that the new version of TVGenial is in Englisch too.
So can be much easy for you.

http://www.tvgenial.com/download.php

Thank you for supporting me

ercuem
Core2Duo
Asus P5B Deluxe Wifi
2 x 500MB / 800Mhz
Twinhan USB DVBT
Skystar 2 / Sattelite
DVB World / Sattelite
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#10
2007-09-08, 01:02 AM (This post was last modified: 2007-11-08, 12:16 AM by pBS.)
for that, you'd probably be best using wintv to record...
gbpvr needs info in the guide to record..tho manual recordings could be done, seems like a lot of work...

basically just make a batch file that can record using wintv's scheduler, and add that as your script..

there is info on the wintv scheduler out there, and it's already made to do this sort of thing..Smile
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  m3u Import mvallevand 3 2,592 2019-04-05, 02:21 AM
Last Post: sub
  Import/export recordings via API? whurlston 4 3,871 2019-02-19, 11:48 AM
Last Post: Graham
  Remote control example code? drmargarit 4 3,875 2018-04-21, 11:24 PM
Last Post: drmargarit
  Conflict recordings scJohn 1 2,628 2018-03-23, 07:43 PM
Last Post: sub
  API / web call for setting recordings Pbathuk 2 3,368 2018-01-13, 05:17 AM
Last Post: Pbathuk
  API access to artwork and deleting recordings cncb 29 15,928 2016-11-06, 02:20 AM
Last Post: mvallevand
  API help - remote control greg in kansas 0 2,690 2016-07-04, 03:54 PM
Last Post: greg in kansas
  How to move recordings without them getting deleted from db drmargarit 4 3,962 2015-09-27, 05:33 PM
Last Post: sub
  Best approach to creating recurring recordings from c# drmargarit 0 2,648 2015-09-27, 01:32 AM
Last Post: drmargarit
  TitanTv Remote Schedule For GBPVR UncleJohnsBand 51 34,236 2015-08-20, 05:11 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode