alexlaverty / python-reddit-youtube-bot

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

Thumbnails not generated #111

Closed sebbourgeois closed 6 months ago

sebbourgeois commented 6 months ago

Hey there !

I'm currently using the last commit, works perfectly (thanks again @azrafe7 !). However, since I'm using that version, thumbnails are not generated anymore.

I just had a look at my settings.py file, everything seems ok :

$ grep thumb config/settings.py
enable_thumbnails = True  # if True generate post thumbnails
thumbnail_image_path = ""
number_of_thumbnails = 1
thumbnail_image_source = "lexica"
thumbnail_text_width = video_width * 0.65
enable_thumbnail_image_gradient = True
thumbnails_directory = str(Path(assets_directory, "images"))

But once the video generation is complete, there's no thumb in the folder :

$ ls videos/1b26j2c_TIFU_by_freaking_out_my_GFs_coworkers_by_taking_he/
final.mp4  meta.json

It doesn't seem to be in the assets/work_dir directory either (don't know if it ever was there, I never paid attention tbh) :

$ ls assets/work_dir/1b26j2c/
comment_ksjc4du.png  comment_ksjleh0.png  comment_ksjumcw.png  comment_ksjztvg.png  comment_ksk8am8.png  comment_kskehc5.png  comment_kskjlku.png  comment_kskv3it.png  comment_ksmgyvt.png  comment_ksn3wq1.png  ksjdry9.mp3  ksjqvs2.mp3  ksk92o2.mp3     selftext_9.mp3
comment_ksjce02.png  comment_ksjpbtw.png  comment_ksjuqu9.png  comment_ksk05kk.png  comment_ksk8gcl.png  comment_kskf4fw.png  comment_kskk292.png  comment_kskwam9.png  comment_ksmhp1l.png  comment_ksn4tn9.png  ksjeku3.mp3  ksjqzr4.mp3  kska5ii.mp3     title.mp3
comment_ksjco4t.png  comment_ksjpl5e.png  comment_ksjuzcw.png  comment_ksk073i.png  comment_ksk8rvj.png  comment_kskg670.png  comment_kskkrap.png  comment_kskxbte.png  comment_ksmisol.png  comment_ksn6a2p.png  ksjhvd5.mp3  ksjr10c.mp3  kskaugv.mp3
comment_ksjcuao.png  comment_ksjpqy4.png  comment_ksjw7iv.png  comment_ksk1lz6.png  comment_ksk92o2.png  comment_kskg8d8.png  comment_kskl046.png  comment_kskyt0h.png  comment_ksmk746.png  comment_ksn9fhg.png  ksjhx6t.mp3  ksjsnws.mp3  kskn4xb.mp3
comment_ksjdry9.png  comment_ksjq01a.png  comment_ksjwjz6.png  comment_ksk2l77.png  comment_ksk9e7y.png  comment_kskgmuh.png  comment_kskl9nn.png  comment_ksl2hh5.png  comment_ksmkwwl.png  comment_ksnfx3r.png  ksjiqd1.mp3  ksjtekn.mp3  ksmhp1l.mp3
comment_ksjeku3.png  comment_ksjq7go.png  comment_ksjwyzz.png  comment_ksk2s2d.png  comment_ksk9i5b.png  comment_kskh137.png  comment_ksklyx3.png  comment_ksl6bb7.png  comment_ksmnjly.png  comment_ksnryy0.png  ksjj99t.mp3  ksjumcw.mp3  selftext_0.mp3
comment_ksjhvd5.png  comment_ksjqbcd.png  comment_ksjx9mi.png  comment_ksk2w3x.png  comment_kska2n5.png  comment_kskh6mw.png  comment_ksklz2g.png  comment_kslfufa.png  comment_ksmo6tq.png  comment_ksnxo4p.png  ksjk3p8.mp3  ksjuqu9.mp3  selftext_1.mp3
comment_ksjhx6t.png  comment_ksjqvs2.png  comment_ksjxhfj.png  comment_ksk3465.png  comment_kska5ii.png  comment_kskhmzh.png  comment_kskn4xb.png  comment_kslphh7.png  comment_ksms670.png  comment_kso0mmz.png  ksjk6x9.mp3  ksjuzcw.mp3  selftext_2.mp3
comment_ksjiqd1.png  comment_ksjqzr4.png  comment_ksjxqj1.png  comment_ksk3knu.png  comment_kska9zd.png  comment_kskhzkq.png  comment_kskoaea.png  comment_kslrf02.png  comment_ksmsxr0.png  comment_ksoctod.png  ksjker8.mp3  ksjxhfj.mp3  selftext_3.mp3
comment_ksjj99t.png  comment_ksjr10c.png  comment_ksjyam0.png  comment_ksk3rs7.png  comment_kskadqn.png  comment_kskj2c4.png  comment_kskoi3p.png  comment_kslrk7k.png  comment_ksmts0v.png  comment_ksoekpb.png  ksjpl5e.mp3  ksjxqj1.mp3  selftext_4.mp3
comment_ksjk0qp.png  comment_ksjsnws.png  comment_ksjycr8.png  comment_ksk4t83.png  comment_kskaugv.png  comment_kskj351.png  comment_kskpr1w.png  comment_kslu217.png  comment_ksmualn.png  comment_ksog7i7.png  ksjpqy4.mp3  ksjyam0.mp3  selftext_5.mp3
comment_ksjk3p8.png  comment_ksjsp8b.png  comment_ksjykgg.png  comment_ksk61b5.png  comment_kskboov.png  comment_kskj3tj.png  comment_kskprg2.png  comment_ksm017g.png  comment_ksmznig.png  ksjc4du.mp3          ksjq01a.mp3  ksjzmmu.mp3  selftext_6.mp3
comment_ksjk6x9.png  comment_ksjt5lo.png  comment_ksjzmmu.png  comment_ksk6rit.png  comment_kskcjcm.png  comment_kskj6v1.png  comment_kskt3jk.png  comment_ksmcwml.png  comment_ksn0cp4.png  ksjco4t.mp3          ksjq7go.mp3  ksjzne9.mp3  selftext_7.mp3
comment_ksjker8.png  comment_ksjtekn.png  comment_ksjzne9.png  comment_ksk82a0.png  comment_kskdug9.png  comment_kskjdxq.png  comment_kskv3h9.png  comment_ksme40d.png  comment_ksn1vl3.png  ksjcuao.mp3          ksjqbcd.mp3  ksk1lz6.mp3  selftext_8.mp3

EDIT : @alexlaverty I had a look at your channel (https://www.youtube.com/@ttsvibelounge/videos), there's no thumbnails on your last videos either, so I suppose it's not from my end :)

azrafe7 commented 6 months ago

@sebbourgeois, it seems to be a problem of the Lexica endpoint, which times out. For example try going to https://lexica.art/api/v1/search?q=What%20stopped%20you%20from%20killing%20yourself%3F (which is what the scripts requests for your example).

I'm getting this trying it now: image

Also, when you run app.py you'll see this in the log:

1b2pbj5, 5431,             8089,             0,             r/AskReddit,             What stopped you from killing yourself?
2024-02-29 16:26:01 INFO     ========== Generating Thumbnail ==========
2024-02-29 16:26:01 INFO     What stopped you from killing yourself?
2024-02-29 16:26:01 INFO     Downloading Image From Lexica : What stopped you from killing yourself?
Error Retrieving Lexica Images  <--
2024-02-29 16:34:10 INFO     ========== Processing Reddit Post ==========
sebbourgeois commented 6 months ago

Ah my bad, didn't check the logs ! I was wondering what was going on, since there was no recent change on the thumb part. Thanks !

EDIT : issue reported on their discord... wait and see !

sebbourgeois commented 6 months ago

Waiting for Lexica, not related to the script