elmoiv / redvid

Smart downloader for Reddit hosted videos
GNU General Public License v3.0
110 stars 15 forks source link

Unable to use Downloader #14

Closed jamoowns closed 4 years ago

jamoowns commented 4 years ago

Describe the bug When running downloader using python 3.7, Video download/encoding fails due to codec

To Reproduce

  1. Using the example script: from redvid import Downloader

reddit = Downloader(max_q=True) reddit.url = 'https://v.redd.it/c8oic7ppc2751' reddit.download()

  1. run the script: python downloader.py

  2. Get the following error:

    Connecting... Scraping... Downloading and Re-encoding... Video:

    Traceback (most recent call last): ] [0.02/1.09 MB] File "downloader.py", line 5, in reddit.download() File "E:\Program Files\Python37\lib\site-packages\redvid\redvid.py", line 249, in download self.get_and_mux() File "E:\Program Files\Python37\lib\site-packages\redvid\redvid.py", line 128, in get_and_mux self.get_video() File "E:\Program Files\Python37\lib\site-packages\redvid\redvid.py", line 116, in get_video self.pgbar(self.log, self.video, 'video.mp4', '>> Video:') File "E:\Program Files\Python37\lib\site-packages\redvid\requestmaker.py", line 224, in pgbar opener.retrieve(url, filename=output_path, reporthook=reporthook) File "E:\Program Files\Python37\lib\urllib\request.py", line 1824, in retrieve reporthook(blocknum, bs, size) File "E:\Program Files\Python37\lib\site-packages\redvid\requestmaker.py", line 200, in reporthook lprint(logg, '\r>>>>', pgbar, end='\r') File "E:\Program Files\Python37\lib\site-packages\redvid\tools.py", line 9, in lprint print(*args, **kwargs) File "E:\Program Files\Python37\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2588' in position 1: character maps to

  3. temp folder contains mp4 with ~1 frame of the video recorded

Expected behavior The video is downloaded as expected

Desktop (please complete the following information):

Additional context Havent been able to get the script working

jamoowns commented 4 years ago

Issue was with the encoding on the terminal, Updated encoding in my terminal following this style: https://stackoverflow.com/questions/32382686/unicodeencodeerror-charmap-codec-cant-encode-character-u2010-character-m

All okay now

elmoiv commented 4 years ago

Ok. thanks for pointing this out :)