raujimenez / tiktok-discord-bot

2 stars 1 forks source link

Install from docker compose? #1

Closed Failead0r closed 3 years ago

Failead0r commented 3 years ago

Good afternoon, I tried to install your bot through docker compose but no luck with this:

version: '3'

services:

  tiktok:
    image: raujimenez/tiktok-downloader-discord-bot:latest
    container_name: TikTokDownloaderBot
    environment:
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - NODE_VERSION=12.22.1
      - YARN_VERSION=1.22.5
      - TOKEN=token_bot
    ports:
      - 10080:80
      - 18080:8080
    restart: unless-stopped

Can you help me, please?

raujimenez commented 3 years ago

Something I see that might be affecting this is that I store the token in a .env file. so maybe you will have to build the docker image yourself and set the environment variables. I am not sure if dotenv node package allows you to access exported environment variables.

As a side note: is your docker registry url pointing to the docker hub registry?

raujimenez commented 3 years ago

just checked again, it seems that dotenv allows us to access shell variables. The only issue I can see right now is not having the docker registry pointing at the correct spot or your token being incorrect. I can investigate more in 6 hours when I get off work. Let me know if you find a solution 👍 .

Failead0r commented 3 years ago

I'm newbie with docker. I'm dockerizing my NAS with Portainer so I don't know how to edit .env docker container. Actually I'm not able to do this.

Could you change that .env parameter (bot's token I mean) and set it through environment variables like Timezone (TZ) or Userid (UID), please?

Thanks for your effort.

raujimenez commented 3 years ago

I copied your docker-compose.yml file from above and I got mine working when I replaced the token environment variable with my discord bot token. One thing I did see was that I needed to have docker desktop open when i tried to run docker-compose up. I got the docker-compose file to work. It should work assuming docker works on your computer.

raujimenez commented 3 years ago

Additionally I would recommend looking over this documentation on having a docker engine going on your linux machine so that you can pull from the registry. I assume since its with your NAS and protainer you don't have a desktop environment for that machine so here is some docker documentation on getting troubleshooting your docker installation. https://docs.docker.com/engine/

Failead0r commented 3 years ago

"token" env variable was lowercase and I wrote it uppercase. Now bot is online and working!

Thank you for all your hard work on this. I'm loving it

PS: any plan to include regular links with @user?

https://www.tiktok.com/@fcbarcelona/video/6971097842219748613?

raujimenez commented 3 years ago

I don't currently have a feature to extend that functionality. If you would like you are more than welcome to create a PR with the extension of the system. If not I can add it later today, I think the tiktokcli allows us to do this.

raujimenez commented 3 years ago

I believe all we would need to do is create a new regex expression to capture https://www.tiktok.com/@user/:videoId when read in the discord message and then add a function to extend the TikTokDownloadService class within the new if else statement in the discord client js file

Failead0r commented 3 years ago

I have done the regex expression to extract @user and @videoid for that kind of url

(@[a-zA-z0-9]*)\/.*\/([\d]*)?

Example: (sorry if you are Real Madrid fan)

https://www.tiktok.com/@fcbarcelona/video/6968563478885895430

Group 1: @fcbarcelona Group2: 6968563478885895430

PS: I would like to say again that I love your bot and thanks for your work

raujimenez commented 3 years ago

Thanks for the feature request, I updated the repository to add the new format of URL. Additionally, I update the docker image in raujimenez/tiktok-downloader-discord-bot to reflect the changes in the GitHub repository. Let me know if you run into any issues or have any other requests or want to contribute to the project so I can give you permissions👍🏼.

PS: I don't mind Real Madrid, I'm more of a Liga MX fan. Cruz Azul al cien!!

Failead0r commented 3 years ago

God bless you and your family. Thanks for the update raujimenez.

PS: would you consider as feature to get automatically uptades from a profile?

Que Dios te bendiga a ti y a los tuyos, muchísimas gracias por la actualización.

PD: ¿considerarías la opción de obtener automáticamente los vídeos o actualizaciones de un determinado perfil?