Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile #2

Closed
jaonoctus opened this issue Apr 26, 2022 · 7 comments
Closed

Dockerfile #2

jaonoctus opened this issue Apr 26, 2022 · 7 comments

Comments

@jaonoctus
Copy link

Description

Even with #1 solved, I still need to install some other dependencies and cannot run the code. Would be nice to have a Dockerfile, so we can ensure that this will work in any environment.

@eddieoz
Copy link
Owner

eddieoz commented May 1, 2022

It could be an interesting solution, but I don't have docker here. And build and updating the containers will need extra maintenance right now.

Pls, can you paste the output of your pip install, so we can have a better idea of what is missing?

@jaonoctus
Copy link
Author

pip install output

Requirement already satisfied: Pillow in /home/jaonoctus/.local/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (9.1.0)
Requirement already satisfied: audiotsm in /home/jaonoctus/.local/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (0.1.2)
Requirement already satisfied: scipy in /home/jaonoctus/.local/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (1.8.0)
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from -r requirements.txt (line 4)) (1.17.4)
Requirement already satisfied: pytube in /home/jaonoctus/.local/lib/python3.8/site-packages (from -r requirements.txt (line 5)) (12.0.0)

marcelo.py output

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
  File "marcelo.py", line 8, in <module>
    from youtube_uploader_selenium import YouTubeUploader
  File "/home/jaonoctus/.local/lib/python3.8/site-packages/youtube_uploader_selenium/__init__.py", line 5, in <module>
    from selenium_firefox.firefox import Firefox, By, Keys
ImportError: cannot import name 'By' from 'selenium_firefox.firefox' (/home/jaonoctus/.local/lib/python3.8/site-packages/selenium_firefox/firefox.py)

@eddieoz
Copy link
Owner

eddieoz commented May 2, 2022

Great, thanks!

I just ran a fresh install under a clean environment and I think I solved all requirement problems.

But there is some fix you need to do manually: Youtube APIs changed an instruction and it needs to be fixed because pytube didn't publish the fix yet.
I updated README with a section known issues showing how to fix it: https://github.com/eddieoz/youtube-clips-automator#known-issues

Please, clone the repo and try pip install.

@eddieoz
Copy link
Owner

eddieoz commented May 3, 2022

I installed docker over here and prepared a Dockerfile. It patches the pytube bug and the build is running properly here.

Pls, give it a test... probably it will be easier to run.

@jaonoctus
Copy link
Author

@eddieoz I can run it now!

I also created a docker-compose.yml,

version: '3'

services:
  marcelo:
    build: .
    container_name: marcelo
    volumes:
      - ./lists:/app/lists
      - ./font:/app/font
      - ./backgrounds:/app/backgrounds
      - ./assets:/app/assets
      - ./thumbs:/app/thumbs

@jaonoctus
Copy link
Author

jaonoctus commented May 5, 2022

Minor feedbacks (not related to this exactly):

  1. Would be nice to move all files to a specific folder (e.g. /output) instead of /, so we can create a binding/mount to export files to the host machine after running the container.

  2. I could not modify the mc.png to other image.

marcelo    | Traceback (most recent call last):
marcelo    |   File "./thumb_generator.py", line 216, in <module>
marcelo    |     main(args.input, args.title, args.no_delete_thumbs)
marcelo    |   File "./thumb_generator.py", line 185, in main
marcelo    |     create_thumbnail(input, title, delete_thumbs)
marcelo    |   File "./thumb_generator.py", line 155, in create_thumbnail
marcelo    |     face = find_smile(frame,text, count)
marcelo    |   File "./thumb_generator.py", line 65, in find_smile
marcelo    |     add_background(resizeimg, text)
marcelo    |   File "./thumb_generator.py", line 96, in add_background
marcelo    |     newimg.paste(mclogo, (W-mclogo_width-5,5), mclogo)
marcelo    |   File "/usr/local/lib/python3.8/site-packages/PIL/Image.py", line 1557, in paste
marcelo    |     self.im.paste(im, box, mask.im)
marcelo    | ValueError: bad transparency mask
  1. Talking about this file, it would make more sense if it's called logo.png instead.

  2. Youtube upload didn't worked, not sure if I need to do something else.

  3. I think that the format of the list.csv is outdated. Generated a thumbnail and the title there was "0" (from the podcast field).

@eddieoz
Copy link
Owner

eddieoz commented May 6, 2022

Thanks for the feedbacks!

  1. Makes sense. For the container I needed to move the .cvs to lists/ because of the same issue. I will manage to review this request.
  2. I will check this issue
  3. I will rename the file
  4. When running for the first time, youtubeuploader needs to open a browser, get the account authorization and the browser try to access an URL on localhost (youtubeuploader stays listening for the callback).

Because it can't access your browser and get the callback because of the container, I recommend running the youtubeuploader manually, outside the container, for uploading any general video (to be excluded after). So it can create the needed authorization file, which the docker build will send to your container to be used the next times.

The process above is needed before building the container just for the first time.

And everything, be sure the client_secrets.json is properly created through the Youtube API v3 proccess on Google Cloud.

  1. Can you share the line of list.csv you are trying please? Because Marcelo edited a clip yesterday and I didn't change the format of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants