alexlaverty / python-reddit-youtube-bot

Automated Reddit Youtube Video Bot
https://www.youtube.com/channel/UCzIwW92D_rM5_yvWBsquSbw
84 stars 19 forks source link

screenshot feature #11

Closed becauseimnoob closed 1 year ago

becauseimnoob commented 2 years ago

resim videos can look more modern with screenshots this feature is used at https://github.com/elebumm/RedditVideoMakerBot/blob/master/video_creation/screenshot_downloader.py

alexdo83 commented 2 years ago

Yes, I love this style too You can also refer here: https://github.com/yvanroan/tiktok-video-mashup-bot/blob/main/get_screenshots.py

alexlaverty commented 2 years ago

I have pushed some changes tonight, so that you can configure comments to be either text or reddit screenshots, self text will still be text thought, give it a try and see how you go.

alexdo83 commented 2 years ago

I have pushed some changes tonight, so that you can configure comments to be either text or reddit screenshots, self text will still be text thought, give it a try and see how you go.

I saw an Update, I tested it!

alexdo83 commented 2 years ago

First of all thanks for your enthusiasm, I really appreciate this :). A little review of the last major update new:

image

Newcaster error?

13

image

beezisback commented 2 years ago

Using TikTok tts i have this error . the file ycuno7_selftext_0.mp3 have 0 kb `Traceback (most recent call last): File "C:\Python310\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 340, in ffmpeg_parse_infos line = [l for l in lines if "Duration:" in l][-1] IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Ambsd\Desktop\TikBot\ttsvibelounge\app.py", line 146, in process_submissions(submissions) File "C:\Users\Ambsd\Desktop\TikBot\ttsvibelounge\app.py", line 44, in process_submissions process_submission(submission) File "C:\Users\Ambsd\Desktop\TikBot\ttsvibelounge\app.py", line 70, in process_submission vid.create(video_directory=video.folder_path, post=submission) File "C:\Users\Ambsd\Desktop\TikBot\ttsvibelounge\video.py", line 274, in create selftext_audioclip = AudioFileClip(selftext_audio_filepath) File "", line 2, in init File "C:\Python310\lib\site-packages\moviepy\decorators.py", line 89, in wrapper return f(*new_a, **new_kw) File "C:\Python310\lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 75, in init self.reader = FFMPEG_AudioReader( File "C:\Python310\lib\site-packages\moviepy\audio\io\readers.py", line 60, in init infos = ffmpeg_parse_infos(filename, decode_file=decode_file) File "C:\Python310\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 344, in ffmpeg_parse_infos raise IOError( OSError: MoviePy error: failed to read the duration of file videos\ycuno7_The_phone_call_from_my_daughter_led_to_the_most_te\ycuno7_selftext_0.mp3. 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 [mp3 @ 000001c2f69395c0] Format mp3 detected only with low score of 1, misdetection possible! [mp3 @ 000001c2f69395c0] Failed to read frame size: Could not seek to 1026. videos\ycuno7_The_phone_call_from_my_daughter_led_to_the_most_te\ycuno7_selftext_0.mp3: Invalid argument

Exception ignored in: <function FFMPEG_AudioReader.del at 0x000002F75A0BAB00> Traceback (most recent call last): File "C:\Python310\lib\site-packages\moviepy\audio\io\readers.py", line 269, in del self.close() File "C:\Python310\lib\site-packages\moviepy\audio\io\readers.py", line 260, in close if self.proc: AttributeError: 'FFMPEG_AudioReader' object has no attribute 'proc' PS C:\Users\Ambsd\Desktop\TikBot\ttsvibelounge>

`

I have pushed some changes tonight, so that you can configure comments to be either text or reddit screenshots, self text will still be text thought, give it a try and see how you go.

alexlaverty commented 2 years ago

Thanks for the quick feedback, I'll have a look at enlarging the images. Tiktok speech engine still needs work because I believe it needs to be done in chunks of less than 300 characters, that's why you're getting errors for tiktok, anything over 300 will fail and produce empty mp3 file. Will probably need to write in chunks and then merge the mp3 files together or something. For the others bug people are getting for the other videos, newscaster etc, I might need to echo out versions of peoples ffmpeg and moviepy libraries etc or do some more debug, not to sure why thats happening for people.

alexlaverty commented 2 years ago

Ok I've added a feature to resize the comment width and a setting to customize the width. I'll have a look at the rest of the stuff when I get some time.

alexdo83 commented 2 years ago

Ok I've added a feature to resize the comment width and a setting to customize the width. I'll have a look at the rest of the stuff when I get some time.

Very good, I tried it and it works perfectly. however there is one problem that the backgrounds sometimes stop 00:00:18 ... (https://drive.google.com/file/d/19h-AJtIyP1d2fUZE-0e3FCKe4I5_5bAs/view?usp=sharing)