2018-01-18, 15:01
(2018-01-17, 18:38)doktourtv Wrote: Would someone kindly look at my playwith.py and tell me where I made my mistake or what I missed.
Attached is my playwith.py, (the autoplaywith.py has exactly the same 2 changes.)
Thank you
playwith.py
python:# Play with your own preferred player and paths
if url:
import re
name = "%s = %s = %s" % (start,channel,re.sub('[^A-Za-z0-9-]','',title))
name = name.encode("cp1252")
#filename = xbmc.translatePath("special://temp/%s.ts" % name)
filename = r"g:\dvr\%s.ts" % name # << THIS IS MY DOWNLOAD DIRECTORY
ffmpeg = r"c:\ffmpeg\bin\ffmpeg.exe" # << THIS IS LOCATION OF MY FFMPEG.EXE
cmd = [ffmpeg, "-y", "-i", url, "-c", "copy", "-t", str(seconds), filename]
#p = Popen(cmd,shell=True)
p = Popen(cmd,shell=False)
You had a tab instead of 4 spaces before filename.
The filename needs to use the raw string format r""
It is safest to remove non ascii characters from the filename. See the re.sub command. That could be done much better for unicode titles.
If you want the ffmpeg process to work in the background swap the commented Popen command around. ie shell=True