How to get and set playback bookmarks via command line?

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
jarnos
Junior
Posts: 22
Joined: Sun Aug 11, 2019 8:17 am
Finland

How to get and set playback bookmarks via command line?

Post by jarnos » Mon Apr 06, 2020 5:01 am

If I want/have to use an external video stream player via MythWeb instead of using MythFrontend, I need a way to get and set bookrmarks via command line. (I am using Linux.) Is that possible? Has anyone done that? mpv can save playback bookmarks at least locally, and I suppose you can read those bookmarks somehow. Maybe some other players have similar features.

User avatar
bill6502
Developer
Posts: 1730
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: How to get and set playback bookmarks via command line?

Post by bill6502 » Mon Apr 06, 2020 2:02 pm

Try mythutil --help. There are also (undocumented) Services API endpoints:

For example: curl --header Accept:application/json yourBackend:6544/Dvr/GetSavedBookmark?ChanId=1051\&StartTime=2020-04-05T22:30
and Dvr/SetSavedBookmark. The latter is a POST and accepts Offset=n. Both can use RecordedId in place of ChanId and StartTime.

Python examples here: https://www.mythtv.org/wiki/Python_API_Examples

Gribnif
Junior
Posts: 67
Joined: Wed May 14, 2014 12:46 pm
United States of America

Re: How to get and set playback bookmarks via command line?

Post by Gribnif » Tue Apr 07, 2020 5:04 pm

I think this script https://github.com/Gribnif/MythPause I wrote may also help.

jarnos
Junior
Posts: 22
Joined: Sun Aug 11, 2019 8:17 am
Finland

Re: How to get and set playback bookmarks via command line?

Post by jarnos » Tue Apr 07, 2020 9:07 pm

bill6502 wrote:
Mon Apr 06, 2020 2:02 pm
Try mythutil --help. There are also (undocumented) Services API endpoints:

For example: curl --header Accept:application/json yourBackend:6544/Dvr/GetSavedBookmark?ChanId=1051\&StartTime=2020-04-05T22:30
and Dvr/SetSavedBookmark. The latter is a POST and accepts Offset=n. Both can use RecordedId in place of ChanId and StartTime.

Python examples here: https://www.mythtv.org/wiki/Python_API_Examples
Oh, but how do you get those IDs if I have just the URL of the stream or ASX?

User avatar
bill6502
Developer
Posts: 1730
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: How to get and set playback bookmarks via command line?

Post by bill6502 » Tue Apr 07, 2020 11:39 pm

Look at the URL, e.g. http://[fdf9:a66:2cd8:1::204]/mythweb/pl/stream/1051/1586300400.asx .
Then try: date --utc +%FT%T --date='@1586300400', or something similar to convert the
time to the required format. The ChanId's already there, 1051 in the example above.
Last edited by bill6502 on Tue Apr 07, 2020 11:59 pm, edited 1 time in total.

Post Reply