0

I try to make a converter application, that can download a video from youtube in .3gpp format and convert it in mp3 but i have some issue about privillages, i dont really now about windows and python privillages.

import pytube
import moviepy.editor as mp

while True:
    url = input("Video url: ")
    print("Downloading video....")
    youtube = pytube.YouTube(url)
    video = youtube.streams.first()
    video.download(r'C:\Users\Silver\Downloads\video.3gpp')
    print("Converting video....") 
    clip = mp.VideoFileClip(r"C:\Users\Silver\Downloads\video.3gpp")
    clip.audio.write_audiofile(r"C:\Users\Silver\Desktop\INFO\PythonFiles\Python\Youtube MP3 Converter\mp3 conv")

Error:

Traceback (most recent call last):
  File "C:\Users\Silver\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 285, in ffmpeg_parse_infos
    line = [l for l in lines if keyword in l][index]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Silver\Desktop\INFO\PythonFiles\Python\Youtube MP3 Converter\Mp3Conv.py", line 12, in <module>
    clip = mp.VideoFileClip(r"C:\Users\Silver\Downloads\video.3gpp")
  File "C:\Users\Silver\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\io\VideoFileClip.py", line 88, in __init__
    self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,
  File "C:\Users\Silver\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 35, in __init__
    infos = ffmpeg_parse_infos(filename, print_infos, check_duration,
  File "C:\Users\Silver\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 289, in ffmpeg_parse_infos
    raise IOError(("MoviePy error: failed to read the duration of file %s.\n"
OSError: MoviePy error: failed to read the duration of file C:\Users\Silver\Downloads\video.3gpp.
Here are the file infos returned by ffmpeg:

ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt

  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100

C:\Users\Silver\Downloads\video.3gpp: Permission denied
  • run the script with administrator privileges (open cmd as admin and then run your script), but you have a different issue to fix which is an index error that is coming from the library? well first try running the script as admin (right click windows icon and press "Command Prompt (Admin)" (at least for Win8.1), then from that cmd run your script) – Matiiss Aug 17 '21 at 19:58
  • still the same error – Mar3C10canar Aug 17 '21 at 20:04
  • 1
    are you sure that the libraries support the file format? why do you even use `3gpp` (sth about telecoms?)? – Matiiss Aug 17 '21 at 20:06

0 Answers0