DBox2Switch bei neueren yWeb

Hier haben Plugin-Entwickler die Möglichkeit, sich auszutauschen.
Benutzeravatar
andre
Senior Member
Beiträge: 115
Registriert: 07 Sep 2008, 15:03

Re: DBox2Switch bei neueren yWeb

Beitrag von andre »

Hallo zusammen,

der Thread ist gut abgehangen, aber bis TV-B 4.2.1 einschließlich hat das Plugin bei mir funktioniert — seit TV-B 4.2.2 leider nicht mehr.

Ich zeige mal das Resultat einer programmierten Aufnahme in der /var/tuxbox/config/timerd.conf im Vergleich. Es wäre toll, wenn es dafür eine Lösung gäbe!

Aufnahme erfolgt nicht (TV-B 4.2.2): Nummer 15
Aufnahme erfolgt (TV-B 4.2.1): Nummer 16

ALARM_TIME_15=1609320312
ALARM_TIME_16=1609321852
ANNOUNCE_TIME_15=1609320132
ANNOUNCE_TIME_16=1609321672
EPG_AUTO_ADJUST_15=0
EPG_AUTO_ADJUST_16=0
EPG_TITLE_15=
EPG_TITLE_16=MDR um 11
EVENT_INFO_APIDS_15=0
EVENT_INFO_APIDS_16=0
EVENT_INFO_CHANNEL_ID_15=-4933688757514572434
EVENT_INFO_CHANNEL_ID_16=4707392121760476742
EVENT_INFO_EPG_ID_15=0
EVENT_INFO_EPG_ID_16=302202976062540638
EVENT_INFO_EPG_STARTTIME_15=0
EVENT_INFO_EPG_STARTTIME_16=1609322400
EVENT_REPEAT_15=0
EVENT_REPEAT_16=0
EVENT_STATE_15=2
EVENT_STATE_16=0
EVENT_TYPE_15=5
EVENT_TYPE_16=5
PREVIOUS_STATE_15=1
PREVIOUS_STATE_16=0
RECORDING_SAFETY_15=1
RECORDING_SAFETY_16=1
REC_DIR_15=/media/movies
REC_DIR_16=/media/movies
REPEAT_COUNT_15=0
REPEAT_COUNT_16=0
STOP_TIME_15=1609324212
STOP_TIME_16=1609323052
ds10
Site Admin
Beiträge: 18338
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: DBox2Switch bei neueren yWeb

Beitrag von ds10 »

Ich kann mir nicht vorstellen, dass das irgendetwas mit der Version von TV-Browser zu tun hat. Denn die Übertragung der Informationen erfolgt durch das Plugin. Die Frage ist also, wie sieht eine Programmierung derselben Sendung (gleicher Datenstand) und denselben Einstellungen im Plugin mit unterschiedlichen TV-Browser-Versionen aus? Die müsste nämlich identisch sein. Aus Daten unterschiedlicher Sendung kannst du nichts Sinnvolles erkennen.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Benutzeravatar
andre
Senior Member
Beiträge: 115
Registriert: 07 Sep 2008, 15:03

Re: DBox2Switch bei neueren yWeb

Beitrag von andre »

Entschuldige, das war für ein Beispiel wirklich blöd, und ich hatte auch gar keine Systeminformationen beigefügt!

Version: 4.2.2
Platform: Mac OS X 10.16
System: x86_64
Java Version:
11.0.9 FYI: Large Heap
Eclipse OpenJ9 VM AdoptOpenJDK /Library/Java/JavaVirtualMachines/adoptopenjdk-11-openj9.jdk/Contents/Home
Location: US,en
Timezone: Central European Standard Time (+1 hours)

Die systematischen Unterschiede waren aber wie beschrieben. Basierend auf deiner Einschätzung, dass es wohl nicht am Plugin liege, habe ich die 4.2.2 sowie ihre Einstellungen gelöscht und eine neuinstallierte 4.2.2 die 4.2.1.0er-Einstellungen frisch importieren lassen. Und nun geht es auch mit der 4.2.2, so dass dieses Problem dadurch wohl behoben wurde.

[OT]
Leider habe auch ich das Problem, dass sich TV-B 4.2.2 beim Start in unregelmäßigen Abständen beim Start beim Füllen der Programmtabelle mit Beach Ball aufhängt und hart beendet werden muss.
[/OT]

Wo ich dich gerade dran habe: DBox2Switch macht seit ein paar Versionen, bei gegebener Funktion, kosmetische Probleme:

Code: Alles auswählen

util.exc.TvBrowserException: The plugin "Dbox2 Switch" caused an error when saving its settings.
  at tvbrowser/tvbrowser.core.plugin.AbstractPluginProxy.saveSettings(AbstractPluginProxy.java:172)
  at tvbrowser/tvbrowser.core.plugin.PluginProxyManager.saveSettings(PluginProxyManager.java:834)
  at tvbrowser/tvbrowser.core.plugin.PluginProxyManager.deactivatePlugin(PluginProxyManager.java:750)
  at tvbrowser/tvbrowser.core.plugin.PluginProxyManager.shutdownAllPlugins(PluginProxyManager.java:851)
  at tvbrowser/tvbrowser.ui.mainframe.MainFrame.quit(MainFrame.java:1629)
  at tvbrowser/tvbrowser.ui.mainframe.MainFrame.quit(MainFrame.java:1587)
  at tvbrowser/tvbrowser.ui.mainframe.MainFrame.quit(MainFrame.java:1583)
  at tvbrowser/tvbrowser.ui.tray.SystemTray$4.windowClosing(SystemTray.java:223)
  at java.desktop/java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
  at java.desktop/java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
  at java.desktop/java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
  at java.desktop/java.awt.Window.processWindowEvent(Unknown Source)
  at java.desktop/javax.swing.JFrame.processWindowEvent(Unknown Source)
  at java.desktop/java.awt.Window.processEvent(Unknown Source)
  at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
  at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
  at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
  at java.base/java.security.AccessController.doPrivileged(Unknown Source)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
  at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
  at java.base/java.security.AccessController.doPrivileged(Unknown Source)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
  at tvbrowser/util.ui.textcomponentpopup.TextComponentPopupEventQueue.dispatchEvent(TextComponentPopupEventQueue.java:55)
  at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: util.exc.TvBrowserException: Saving data for plugin "Dbox2 Switch" failed.
(/Users/me/Library/Preferences/TV-Browser/4.2.2/java.dboxswitch.DboxSwitch.dat.temp)
  at tvbrowser/tvbrowser.core.plugin.JavaPluginProxy.doSaveSettings(JavaPluginProxy.java:288)
  at tvbrowser/tvbrowser.core.plugin.AbstractPluginProxy.saveSettings(AbstractPluginProxy.java:169)
  ... 35 more
Caused by: java.lang.NoSuchMethodError: devplugin/Date.writeData(Ljava/io/ObjectOutputStream;)V (loaded from file:/private/var/folders/9r/k5gb9_651xd04d3k4s_s_v0c0000gp/T/AppTranslocation/93B0539A-E5C9-4AD9-8B06-0F5090717EDA/d/TV-Browser.app/Contents/Resources/tvbrowser.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@a9a318e9) called from class dboxswitch.DboxDevice (loaded from file:/Users/me/Library/Application%20Support/TV-Browser/plugins/DboxSwitch.jar by java.net.FactoryURLClassLoader@2c2fcdad).
  at dboxswitch.DboxDevice.writeData(DboxDevice.java:510)
  at dboxswitch.DboxSwitch.writeData(DboxSwitch.java:250)
  at tvbrowser/tvbrowser.core.plugin.JavaPluginProxy$1.process(JavaPluginProxy.java:270)
  at tvbrowser/util.io.stream.StreamUtilities.objectOutputStream(StreamUtilities.java:345)
  at tvbrowser/tvbrowser.core.plugin.JavaPluginProxy.doSaveSettings(JavaPluginProxy.java:267)
  ... 36 more
util.exc.TvBrowserException: Saving data for plugin "Dbox2 Switch" failed.
(/Users/me/Library/Preferences/TV-Browser/4.2.2/java.dboxswitch.DboxSwitch.dat.temp)
  at tvbrowser/tvbrowser.core.plugin.JavaPluginProxy.doSaveSettings(JavaPluginProxy.java:288)
  at tvbrowser/tvbrowser.core.plugin.AbstractPluginProxy.saveSettings(AbstractPluginProxy.java:169)
  at tvbrowser/tvbrowser.core.plugin.PluginProxyManager.saveSettings(PluginProxyManager.java:834)
  at tvbrowser/tvbrowser.core.plugin.PluginProxyManager.deactivatePlugin(PluginProxyManager.java:750)
  at tvbrowser/tvbrowser.core.plugin.PluginProxyManager.shutdownAllPlugins(PluginProxyManager.java:851)
  at tvbrowser/tvbrowser.ui.mainframe.MainFrame.quit(MainFrame.java:1629)
  at tvbrowser/tvbrowser.ui.mainframe.MainFrame.quit(MainFrame.java:1587)
  at tvbrowser/tvbrowser.ui.mainframe.MainFrame.quit(MainFrame.java:1583)
  at tvbrowser/tvbrowser.ui.tray.SystemTray$4.windowClosing(SystemTray.java:223)
  at java.desktop/java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
  at java.desktop/java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
  at java.desktop/java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
  at java.desktop/java.awt.Window.processWindowEvent(Unknown Source)
  at java.desktop/javax.swing.JFrame.processWindowEvent(Unknown Source)
  at java.desktop/java.awt.Window.processEvent(Unknown Source)
  at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
  at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
  at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
  at java.base/java.security.AccessController.doPrivileged(Unknown Source)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
  at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
  at java.base/java.security.AccessController.doPrivileged(Unknown Source)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
  at tvbrowser/util.ui.textcomponentpopup.TextComponentPopupEventQueue.dispatchEvent(TextComponentPopupEventQueue.java:55)
  at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NoSuchMethodError: devplugin/Date.writeData(Ljava/io/ObjectOutputStream;)V (loaded from file:/private/var/folders/9r/k5gb9_651xd04d3k4s_s_v0c0000gp/T/AppTranslocation/93B0539A-E5C9-4AD9-8B06-0F5090717EDA/d/TV-Browser.app/Contents/Resources/tvbrowser.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@a9a318e9) called from class dboxswitch.DboxDevice (loaded from file:/Users/me/Library/Application%20Support/TV-Browser/plugins/DboxSwitch.jar by java.net.FactoryURLClassLoader@2c2fcdad).
  at dboxswitch.DboxDevice.writeData(DboxDevice.java:510)
  at dboxswitch.DboxSwitch.writeData(DboxSwitch.java:250)
  at tvbrowser/tvbrowser.core.plugin.JavaPluginProxy$1.process(JavaPluginProxy.java:270)
  at tvbrowser/util.io.stream.StreamUtilities.objectOutputStream(StreamUtilities.java:345)
  at tvbrowser/tvbrowser.core.plugin.JavaPluginProxy.doSaveSettings(JavaPluginProxy.java:267)
  ... 36 more
java.lang.NoSuchMethodError: devplugin/Date.writeData(Ljava/io/ObjectOutputStream;)V (loaded from file:/private/var/folders/9r/k5gb9_651xd04d3k4s_s_v0c0000gp/T/AppTranslocation/93B0539A-E5C9-4AD9-8B06-0F5090717EDA/d/TV-Browser.app/Contents/Resources/tvbrowser.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@a9a318e9) called from class dboxswitch.DboxDevice (loaded from file:/Users/me/Library/Application%20Support/TV-Browser/plugins/DboxSwitch.jar by java.net.FactoryURLClassLoader@2c2fcdad).
  at dboxswitch.DboxDevice.writeData(DboxDevice.java:510)
  at dboxswitch.DboxSwitch.writeData(DboxSwitch.java:250)
  at tvbrowser/tvbrowser.core.plugin.JavaPluginProxy$1.process(JavaPluginProxy.java:270)
  at tvbrowser/util.io.stream.StreamUtilities.objectOutputStream(StreamUtilities.java:345)
  at tvbrowser/tvbrowser.core.plugin.JavaPluginProxy.doSaveSettings(JavaPluginProxy.java:267)
  at tvbrowser/tvbrowser.core.plugin.AbstractPluginProxy.saveSettings(AbstractPluginProxy.java:169)
  at tvbrowser/tvbrowser.core.plugin.PluginProxyManager.saveSettings(PluginProxyManager.java:834)
  at tvbrowser/tvbrowser.core.plugin.PluginProxyManager.deactivatePlugin(PluginProxyManager.java:750)
  at tvbrowser/tvbrowser.core.plugin.PluginProxyManager.shutdownAllPlugins(PluginProxyManager.java:851)
  at tvbrowser/tvbrowser.ui.mainframe.MainFrame.quit(MainFrame.java:1629)
  at tvbrowser/tvbrowser.ui.mainframe.MainFrame.quit(MainFrame.java:1587)
  at tvbrowser/tvbrowser.ui.mainframe.MainFrame.quit(MainFrame.java:1583)
  at tvbrowser/tvbrowser.ui.tray.SystemTray$4.windowClosing(SystemTray.java:223)
  at java.desktop/java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
  at java.desktop/java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
  at java.desktop/java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
  at java.desktop/java.awt.Window.processWindowEvent(Unknown Source)
  at java.desktop/javax.swing.JFrame.processWindowEvent(Unknown Source)
  at java.desktop/java.awt.Window.processEvent(Unknown Source)
  at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
  at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
  at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
  at java.base/java.security.AccessController.doPrivileged(Unknown Source)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
  at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
  at java.base/java.security.AccessController.doPrivileged(Unknown Source)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
  at tvbrowser/util.ui.textcomponentpopup.TextComponentPopupEventQueue.dispatchEvent(TextComponentPopupEventQueue.java:55)
  at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
ds10
Site Admin
Beiträge: 18338
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: DBox2Switch bei neueren yWeb

Beitrag von ds10 »

Der Fehler kann nur im Quellcode des Plugins beseitigt werden, da es einfach so alt ist, dass es Methoden benutzt, die es mittlerweile nicht mehr in TV-Browser gibt.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Benutzeravatar
Agrivaine
Moderator
Beiträge: 776
Registriert: 21 Nov 2007, 14:39
Kontaktdaten:

Re: DBox2Switch bei neueren yWeb

Beitrag von Agrivaine »

Ist der Receiver so alt wie das Plugin? Bspw. umschalten und Aufnahmeprogrammierung würde auch über das CapturePlugin funktionieren.
Gestern standen wir vor dem Abgrund; heute sind wir bereits einen Schritt weiter...
Benutzeravatar
andre
Senior Member
Beiträge: 115
Registriert: 07 Sep 2008, 15:03

Re: DBox2Switch bei neueren yWeb

Beitrag von andre »

Der Receiver ist eine 4K-fähige Zgemma H7C mit Keywelt-Image V4.12b1 vom Juli 2020.

Mit Neutrino* kann man über ein Web-Interface interagieren. Hier ist ein Beipiel für einen API-Call zum Erstellen einer Aufnahme:

Mit Unix epoch
>>>http://box_ip/control/timer?action=new&alarm=1034309576&stop=1034284376&announce=1034309576&type=1&rep=1&channel_id=16dcb
ok

Eher Klartext
>>>http://box_ip/control/timer?action=new&alDate=24.01.2006&alTime=20.00&stTime=20.15&channel_name=Das%20Erste&update=1
ok

Löschen der Aufnahme habe ich nicht gefunden, jedoch könnte ich mich da schlau machen. Die URL könnte ich durch curl oder wget aufrufen lassen.

Kann TV-B entsprechende Daten an das Capture Plugin übergeben, und könntet ihr mir vielleicht eine kleine Starthilfe bzw. Dokumentation dazu geben?
ds10
Site Admin
Beiträge: 18338
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: DBox2Switch bei neueren yWeb

Beitrag von ds10 »

Der Standardtreiber der Aufnahmesteuerung erlaubt direkt URLs aufzurufen, da braucht man kein externes Programm.
Beispiele für die Einrichtung findest du unter: Unterstützte Hard- und Software
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Benutzeravatar
andre
Senior Member
Beiträge: 115
Registriert: 07 Sep 2008, 15:03

Re: DBox2Switch bei neueren yWeb

Beitrag von andre »

Vielen Dank!

Irgendwie finde ich das Capture-Plugin selbst aber nicht... :oops:

... dafür dein Switch Plugin, und damit habe ich's ans Laufen gebracht. Leider ist damit nur ein einziger Befehl möglich.

Jedenfalls habe ich die vorhandenen Quellen durchgesehen, vereinfacht und dergestalt verbessert, dass man die IDs nicht mehr selber heraussuchen muss.

Code: Alles auswählen

#!/bin/bash
# tvb2dbox.sh
# Use the TV-Browser plugin "Switch" to create a Neutrino recording timer
# by andre, 2020-12-30, v4

# The matching plugin setting must be enclosed in double quotes:
# "http://${box_ip}/control/timer?action=new&alarm={start_unix}&announce={start_unix}&channel_id={channel_name}&rs=1&stop={end_unix}"
#
# For his to work, make sure the following conditions are met: 
# - There is a corresponding Neutrino "Favorite", as they lead the list
# - TV-Browser: Graphical Settings: Configure selected channels 
# 	exactly matches the Neutrino Favorite's name in a case-sensitive manner
#
# Configure the Neutrino box IP address
box_ip="h7"

### No configuration below this line
if [ "$1" = "" ] ; then
  echo "Usage: $0 <url>"
	exit 1
else
  tvb=$1
fi
# Extract the channel name
name=$( echo ${tvb} | sed -e "s@.*channel_id=\(.*\).rs=.*stop=.*@\1@" ) 
# Get the channel list
list=$( curl -s "http://${box_ip}/control/channellist" )
# Get the first matching channel id
eval channel=$( echo "${list}" | while read entry ; do 
	c_id=$( echo ${entry} | sed -e "s@ .*@@" )
	c_name=$( echo ${entry} | sed -e "s@${c_id} \(.*\)@\1@" )
	if [ "${c_name}" = "${name}" ] ; then
		echo "${c_id}"
		break
	else
		continue
	fi
done
)
# Replace the channel name by the channel id
dbox=$( echo ${tvb} | sed -e "s@${name}@${channel}@" -e 's@^"@@' -e 's@"$@@' )
# Set the timer
curl --silent "${dbox}"
Dateianhänge
Screen Shot 2020-12-30 at 22.12.55.png
Screen Shot 2020-12-30 at 22.12.55.png (1.29 MiB) 5026 mal betrachtet
Screen Shot 2020-12-30 at 22.12.10.png
Screen Shot 2020-12-30 at 22.12.10.png (91.38 KiB) 5026 mal betrachtet
ds10
Site Admin
Beiträge: 18338
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: DBox2Switch bei neueren yWeb

Beitrag von ds10 »

Das CapturePlugin heißt Aufnahmesteuerung.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Benutzeravatar
andre
Senior Member
Beiträge: 115
Registriert: 07 Sep 2008, 15:03

Re: DBox2Switch bei neueren yWeb

Beitrag von andre »

Inzwischen hatte ich das Capture Plugin auch gefunden, es heißt bei mir "Recording control" und ist wirklich toll.

Neue Version des Scripts:

Code: Alles auswählen

#!/bin/bash
# tvb2dbox.sh
# Use the TV-Browser plugin "Switch" to create a Neutrino recording timer
# by andre, 2020-12-31, v6
# USE AT YOUR OWN RISK

# Set the Neutrino box IP address or DNS name
box_ip="h7"

### No configuration below this line
if [ "$1" = "" ] ; then
  echo "Usage: $0 URL"
	echo "Use the TV-Browser plugin \"Switch\" to create a Neutrino recording timer."
	echo ""
	echo "All of the following conditions must be met:"
	echo " - The Switch plugin's \"External application\" is set to: $0"
	echo " - The Switch plugin's \"Application/Parameters\" is enclosed in double quotes:"
	echo "   \"http://${box_ip}/control/timer?action=new&alarm={start_unix}&announce={start_unix}&channel_id={channel_name}&rs=1&stop={end_unix}\""
	echo " - The Switch plugin's \"Channels\" and Neutrino's \"Favorites\" match 100 % (for every channel you want to record)"
	echo "   (Cf. \"TV-Browser: Graphical Settings: Configure selected channels\")"
	echo " - You have set up \"box_ip\" within this script correctly." 
	echo "   (Use a text editor w/ *nix line-breaks for that.)"
	echo "To check, point your web-browser to: http://${box_ip}/Y_Timer_List.yhtm"
	exit 1
else
  tvb=$1
fi
# Extract the channel name
name=$( echo ${tvb} | sed -e "s@.*channel_id=\(.*\).rs=.*stop=.*@\1@" ) 
# Get the channel list
list=$( curl -s "http://${box_ip}/control/channellist" )
# Get the first matching channel id
eval channel=$( echo "${list}" | while read entry ; do 
	c_id=$( echo ${entry} | sed -e "s@ .*@@" )
	c_name=$( echo ${entry} | sed -e "s@${c_id} \(.*\)@\1@" )
	if [ "${c_name}" = "${name}" ] ; then
		echo "${c_id}"
		break
	else
		continue
	fi
done
)
# Replace the channel name by the channel id and remove the enclosing quotes
dbox=$( echo ${tvb} | sed -e "s@${name}@${channel}@" -e 's@^"@@' -e 's@"$@@' )
# Set the timer
curl --silent "${dbox}"
Eine Möglichkeit zum Entfernen des Timers habe ich leider noch nicht gefunden.

Neue Screenshots:
Dateianhänge
Screen Shot 2020-12-31 at 09.50.51.png
Screen Shot 2020-12-31 at 09.50.51.png (892.61 KiB) 5002 mal betrachtet
Screen Shot 2020-12-31 at 09.50.38.png
Screen Shot 2020-12-31 at 09.50.38.png (610.2 KiB) 5002 mal betrachtet
Screen Shot 2020-12-31 at 09.53.05.png
Screen Shot 2020-12-31 at 09.53.05.png (236.88 KiB) 5002 mal betrachtet
Benutzeravatar
andre
Senior Member
Beiträge: 115
Registriert: 07 Sep 2008, 15:03

Re: DBox2Switch bei neueren yWeb

Beitrag von andre »

Ich habe mir nun einen langgehegten Wunsch erfüllt: Aufnahme-Timer und deren Löschungen werden sowohl mit Neutrino als auch mit iCal gesynct.

Leider kann ich hier nur den Code posten und keinen Tarball, sonst hätte ich die .tcf für das Plugin "Aufnahmesteuerung" bzw. "Recording control" mit hinein gepackt und angehängt. Aus den Kommentaren kann man aber ersehen, wie man das Plugin einrichten muss.

Frohes neues Jahr!

Code: Alles auswählen

#!/bin/bash
# tvb2AB.sh
# Launcher for TV-Browser "Recording control" plugin with optional iCal support
# by andre, 2021-01-02, v3
# USE AT YOUR OWN RISK

# The Neutrino Box's IP address or DNS name (required)
box_ip="h7"
# Seconds to start recordings earlier (required; must match Neutrino's settings)
rec_corr_start="300"
# Seconds to end recordings later (required; must match Neutrino's settings)
rec_corr_end="600"
# Path to your web-browser binary (optional; leave blank if you don't want it to open)
webbrowser="/usr/bin/open"
# iCal calendar to use (optional; leave blank if you don't want iCal. If set, the calendar is created automatically if necessary)
ical_name="TV-Browser"

### No configuration below this line
# The parameters "actors" and "description" cause trouble and are left out
# "Recording control" plugin's "Parameter for recording"
# "<TVB2AB_action>ADD</TVB2AB_action><TVB2AB_channel_name>{channel_name}</TVB2AB_channel_name><TVB2AB_end_unix>{end_unix}</TVB2AB_end_unix><TVB2AB_episode>{episode}</TVB2AB_episode><TVB2AB_episode_number>{episode_number}</TVB2AB_episode_number><TVB2AB_genre>{genre}</TVB2AB_genre><TVB2AB_length_minutes>{length_minutes}</TVB2AB_length_minutes><TVB2AB_origin>{origin}</TVB2AB_origin><TVB2AB_original_episode>{original_episode}</TVB2AB_original_episode><TVB2AB_original_title>{original_title}</TVB2AB_original_title><TVB2AB_production_year>{production_year}</TVB2AB_production_year><TVB2AB_season_number>{season_number}</TVB2AB_season_number><TVB2AB_start_unix>{start_unix}</TVB2AB_start_unix><TVB2AB_title>{title}</TVB2AB_title><TVB2AB_url>{url}</TVB2AB_url>"
# "Recording control" plugin's "Parameter for deletion"
# "<TVB2AB_action>DEL</TVB2AB_action><TVB2AB_channel_name>{channel_name}</TVB2AB_channel_name><TVB2AB_end_unix>{end_unix}</TVB2AB_end_unix><TVB2AB_episode>{episode}</TVB2AB_episode><TVB2AB_episode_number>{episode_number}</TVB2AB_episode_number><TVB2AB_genre>{genre}</TVB2AB_genre><TVB2AB_length_minutes>{length_minutes}</TVB2AB_length_minutes><TVB2AB_origin>{origin}</TVB2AB_origin><TVB2AB_original_episode>{original_episode}</TVB2AB_original_episode><TVB2AB_original_title>{original_title}</TVB2AB_original_title><TVB2AB_production_year>{production_year}</TVB2AB_production_year><TVB2AB_season_number>{season_number}</TVB2AB_season_number><TVB2AB_start_unix>{start_unix}</TVB2AB_start_unix><TVB2AB_title>{title}</TVB2AB_title><TVB2AB_url>{url}</TVB2AB_url>"

func_epochtoas () {
	epochtoas=$( date -j -R -r "$1" )
	echo "${epochtoas}"
}

func_pingneutrino () {
	if ! ping -c1 ${box_ip} ; then
		echo "${box_ip} unavailable; exiting" 
		exit 1
	fi
}

func_webbrowser () {
	if [ "${webbrowser}" != "" ] ; then
		func_pingneutrino
		"${webbrowser}" "$1"
	fi
}

if [ "$1" = "" ] ; then
  echo "Usage: $0 URL"
	exit 1
else
  tvb=$1 
	func_pingneutrino
fi

# pass1
eval $(
	# The parameters "actors" and "description" cause trouble and are left out
	for param in action channel_name episode end_unix episode_number genre length_minutes origin original_episode original_title production_year season_number start_unix title url ; do
		value=$( echo "${tvb}" | tr '\n' ' ' | sed -e 's@</TVB2AB_'${param}'>.*@@' -e 's@.*<TVB2AB_'${param}'>@@' )
		echo "${param}=\"${value}\""
done
)

# plausability check
if [ "${start_unix}" = "" ] || [ "${end_unix}" = "" ] || [ "${start_unix}" = "${end_unix}" ] ; then
  echo "Invalid start_unix or end_unix date; exiting."
  exit 1
fi 

if [ "${ical_name}" != "" ] ; then
	# iCal entry
	ical_start=$( func_epochtoas "${start_unix}" )
	ical_end=$( func_epochtoas "${end_unix}" )
	ical_summary="${title} - ${channel_name}"
	ical_description="Genre: ${genre}
	Origin: ${origin}
	Length (mins.): ${length_minutes}
	Original Title: ${original_title}
	Production Date: ${production_year}
	Season: ${season_number}
	Epsisode Number: ${episode_number}
	Episode: ${episode}
	Original Episode: ${original_episode}"
	#Actors: ${actors}"
	#Description: ${description}
	#Short Info: ${short_info}
	ical_url=${url}
	#echo "ical_name ${ical_name}"
	#echo "ical_start ${ical_start}"
	#echo "ical_end ${ical_end}"
	#echo "ical_summary ${ical_summary}"
	#echo "ical_description ${ical_description}"
	#echo "ical_url ${ical_url}"
fi

if [ "${action}" = "ADD" ] ; then
	# Neutrino timer
	func_pingneutrino
	list=$( curl -s "http://${box_ip}/control/channellist" )
	# Get the first matching channel id
	channel_id=$( echo "${list}" | grep "${channel_name}$" | head -n 1 | sed -e "s@ .*@@" )
	# Prepare Neutrino timer
	tvb2dbox="http://${box_ip}/control/timer?action=new&alarm=${start_unix}&announce=${start_unix}&channel_id=${channel_id}&rs=1&stop=${end_unix}"
	# Create Neutrino timer
	func_pingneutrino
	curl -s "${tvb2dbox}"
	func_webbrowser "http://${box_ip}/Y_Timer_List.yhtm" 
	if [ "${ical_name}" != "" ] ; then
		# Create ical event
		osascript -e "
			set ical_calendar to \"${ical_name}\"
			set ical_start to date (\"${ical_start}\" as string)
			set ical_end to date (\"${ical_end}\" as string)
			set ical_summary to \"${ical_summary}\"
			set ical_description to \"${ical_description}\"
			set ical_url to \"${ical_url}\"
			tell application \"Calendar\"
				try
					set theCalendarName to \"${ical_name}\"
					set theCalendar to first calendar where its name = theCalendarName
				on error
					set theNewCalendar to make new calendar with properties {name:theCalendarName, description:\"${ical_name}\"}
				end try
				tell calendar \"${ical_name}\"
					make new event with properties {summary:ical_summary, start date:ical_start, end date:ical_end, description:ical_description, url:ical_url}
				end tell
			end tell
		"
	fi
fi

if [ "${action}" = "DEL" ] ; then
	# Neutrino timer
	#echo "You need to remove The Neutrino timer manually."
	#echo "I will try to open your web-browser for you."
	del_start=$(( ${start_unix} - ${rec_corr_start} ))
	del_end=$(( ${end_unix} + ${rec_corr_end} ))
	func_pingneutrino
	curl -s "http://${box_ip}/control/timer" | grep "${del_start}" | grep "${del_end}" | grep "${channel_name}" | sed -e "s@ .*@@" | while read timer ; do 
		func_pingneutrino
		curl -s "http://${box_ip}/fb/timer.dbox2?action=remove&id=${timer}"
	done
	func_webbrowser "http://${box_ip}/Y_Timer_List.yhtm"
	if [ "${ical_name}" != "" ] ; then
		# Remove ical event
		# exec need for TV-Browser timing
		( exec osascript -e "
			set ical_calendar to \"${ical_name}\"
			set ical_start to date (\"${ical_start}\" as string)
			set ical_end to date (\"${ical_end}\" as string)
			set ical_summary to \"${ical_summary}\"
			set ical_description to \"${ical_description}\"
			set ical_url to \"${ical_url}\"
			tell application \"Calendar\"
					try
						set theCalendarName to \"${ical_name}\"
						set theCalendar to first calendar where its name = theCalendarName
					on error
						set theNewCalendar to make new calendar with properties {name:theCalendarName, description:\"${ical_name}\"}
					end try
					tell calendar \"${ical_name}\"
						try
						set ical_remove to events whose (start date is ical_start and end date is ical_end and summary is ical_summary )
							repeat with ical_event in ical_remove
								delete ical_event
							end repeat
						end try
					end tell
				end tell 
			"
		) & disown 
	fi
fi
ds10
Site Admin
Beiträge: 18338
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: DBox2Switch bei neueren yWeb

Beitrag von ds10 »

Also tar- bzw. tar.gz-, zip-Dateien und auch die tcf-Dateien kann man hier direkt als Dateianhang hochladen. Noch besser wäre allerdings, wenn du einen Eintrag im Handbuch erstellen/aktualisieren würdest.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Benutzeravatar
andre
Senior Member
Beiträge: 115
Registriert: 07 Sep 2008, 15:03

Re: DBox2Switch bei neueren yWeb

Beitrag von andre »

Ich habe jetzt den Artikel Aufnahmesteuerung_-_Neutrino erstellt, aber ich darf außer Mediendateien nichts hochladen!
ds10
Site Admin
Beiträge: 18338
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: DBox2Switch bei neueren yWeb

Beitrag von ds10 »

Hänge die tcf-Datei einfach hier im Forum an, dann kann ich die hochladen.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Benutzeravatar
andre
Senior Member
Beiträge: 115
Registriert: 07 Sep 2008, 15:03

Re: DBox2Switch bei neueren yWeb

Beitrag von andre »

Ich bin einfach zu blöd!

SHA-512
c00cffed28e609221831ed3b862c8a371328b0c88455ed854d9b57b32a60c0964a723a546b2db46b67686819deeced8ba9b672e71324635b1310844cfb52baa6 tvb2AB.tar.gz
Dateianhänge
tvb2AB.tar.gz
(4.4 KiB) 137-mal heruntergeladen
Antworten