|
|
|
@ -416,6 +416,19 @@ async def main():
|
|
|
|
|
if pmedia: |
|
|
|
|
pmedia = urljoin(url, pmedia) |
|
|
|
|
await _download_file(filename, pmedia) |
|
|
|
|
if await _get_file_mimetype(filename) == 'video/x-m4v': |
|
|
|
|
ofilename = filename + '.oc' |
|
|
|
|
os.rename(filename, ofilename) |
|
|
|
|
proc = await asyncio.create_subprocess_exec('ffmpeg', '-nostdin', '-y', '-i', ofilename, '-c', 'copy', '-f', 'mp4', filename) |
|
|
|
|
await proc.communicate() |
|
|
|
|
if not proc.returncode: |
|
|
|
|
os.remove(ofilename) |
|
|
|
|
else: |
|
|
|
|
os.rename(ofilename, filename) |
|
|
|
|
try: |
|
|
|
|
os.remove(filename) |
|
|
|
|
except FileNotFoundError: |
|
|
|
|
pass |
|
|
|
|
files.append(filename) |
|
|
|
|
if pdesc: |
|
|
|
|
caplength = 1023 if pmedia else 4095 |
|
|
|
|