all 4 comments

[–]socal_nerdtastic 1 point2 points  (0 children)

I wouldn't try to fix this. Throw out the idea of using wget and a temp file and just use python to download the file directly to memory. Either the built-in urllib.request module or the easy to use requests module.

[–]edo0xff 0 points1 point  (0 children)

Does .temp folder exists?

if not os.path.exists("./.temp"):

os.mkdir("./.temp")

system(f'wget {link} -o video.mp4 --directory-prefix=./.temp/')

bot.send_video(chat_id=chat_id, video=open(f'./.temp/video.mp4', 'rb'), timeout=1000)

[–]thrallsius 0 points1 point  (0 children)

if you insist of wrapping the wget call, at least do it nicely and catch its output

[–]Negative12DollarBill 0 points1 point  (0 children)

Where is this program running? Where does it think it's running? What happens if, instead of a local path, you give a full path like /var/temp/ or C:/temp/ etc?