Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess, shlex, re
- if __name__ == '__main__':
- file = input("Filename:").replace('"','')
- info = re.search(r'(.+)\[sound=(\S+\.(\S+))\]', file, flags=re.I)
- original_name = info.group(1).strip()
- url = info.group(2).replace("%2F","/").replace("%3A",":")
- if not re.match("http", url):
- url = "https://" + url
- sound_ext = info.group(3)
- if sound_ext in ['ogg', 'opus', 'webm']:
- a_codec = "copy"
- else:
- a_codec = "libopus"
- subprocess.run(shlex.split(r'ffmpeg.exe -i "' + file + r'" -i "' + url + r'" -c:v copy -c:a ' + a_codec + r' -y "' + original_name + r'.webm"'))
Add Comment
Please, Sign In to add comment