... and works here as well. Though it had been a bit of a challenge to figure out that the new destination file must exist before you can refer to it; the api obviously checks for its presence and ignores the request if it is missing. And the api is not very verbose when it comes to error reporting :-/
After figuring out what curl does:
With a recording test1.ts and a copy of it test2.ts in the same directory /home/videos/tvheadend you can update the dvr/log files by:
http://user:password@localhost:9981/api/dvr/entry/filemoved?src=/home/videos/tvheadend/test1.ts&dst=/home/videos/tvheadend/test2.ts
The Python2 version then looks like this:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib
api_url = 'http://user:password@localhost:9981/api/dvr/entry/filemoved'
file_from = '/home/videos/tvheadend/test1.ts'
file_to = '/home/videos/tvheadend/test2.ts'
post = urllib.urlencode({ 'src' : file_from, 'dst' : file_to})
print "post", post
response = urllib.urlopen(api_url + "?" + post)
upcoming = response.read()
print upcoming
Indeed much simpler than fiddling with the log files! Looks like the solution to Nic Butcher's original question.
But, assuming you keep tvh running, if I am not mistaken you must firstcopy the file to the new location, thenupdate via api, thendelete the original file. Because otherwise tvh may declare the file as lost. Not sure how to get it back.