Parse youtube channels, and post videos to vk.com public page, and telegram channel.
Example vk public pages:
git clone [email protected]:theaidem/postube.git project_name
project_name
is the name of the project without spaces ex. postube
, tube_poster
, etc
cp .env.example .env
then edit .env
file
cp config/config.example.yaml config/config.yaml
without spaces, example: postube
, sciencevideos
, define and create config for them:
cp ./config/tube.config.example.yaml ./config/TUBE_NAME.config.yaml
TUBE_NAME is a name of the tube
...
tubes:
- postube
# - sciencevideos
# - etcmoves
...
Ok, below we will edit your ./config/TUBE_NAME.config.yaml
Firstly, let's create a Standalone app
Opening OAuth Authorization Dialog:
https://oauth.vk.com/authorize?client_id=APP_ID&redirect_uri=https://vk.com&scope=73744&response_type=code&v=5.92
The APP_ID is your standalone application ID
After successful application authorization, user's browser will be redirected to redirect_uri
URL specified when the authorization dialog box was opened. With that, code to receive code access key will be passed in GET parameter to the specified URL:
http://redirect_uri?code=7a6fa4dff77a228eeda56603b8f53806c883f011c40b72630bb50df056f6479e52a
Receiving "access_token":
https://oauth.vk.com/access_token?client_id=APP_ID&client_secret=APP_SECRET&code=CODE&redirect_uri=https://vk.com
The APP_ID is your standalone application ID
The APP_SECRET secret key of the standalone application
The CODE code parameter from the previous step
Example of server response:
{
"access_token":"533bacf01e11f55b536a565b57531ac114461ae8736d6506a3", "expires_in":43200,
"user_id":6492
}
Copy access_token
to ./config/TUBE_NAME.config.yaml
...
# Token, for access VK API
accessToken: "access_token"
...
More about authorization see there
https://vk.com/groups?w=groups_create
Paste your group id to ./config/TUBE_NAME.config.yaml
...
# Your public ID
groupID: "group_id"
...
Follow https://telegram.me/BotFather
Paste your API token to ./config/TUBE_NAME.config.yaml
...
# Token your telegram bot
token: "telegram_api_token"
...
Paste channel name to ./config/TUBE_NAME.config.yaml
...
# Name your chanel, example: "@postube"
channel: "@name"
...
Example:
# Youtube channels ID's
channels:
# SpaceX (example!)
- UCtI0Hodo5o5dUb67FeUjDeA
# BostonDynamics (example!)
- UC7vVhkEfw4nOGp8TyDk7RcQ
make run
This optional step, you can use your own approach for that, anyway
Makefile
is your friend ;)
Edit .env
vars, USER
HOST
APP_PATH
See comments for details
make upload.all
Make sure Docker has been installed on your server
make remote.build.docker.image
and run it
make remote.run.docker.conatainer
check container logs
make remote.logs.docker.image
You can edit config.yaml
locally, and upload to server, the application will re-reading the config file automatically
make upload.config
Also, you can upload TUBE_NAME.config.yaml
configs
TUBE_NAME is a name of the tube
make upload.tube.config tube=TUBE_NAME