Skip to content

Commit dd10af1

Browse files
committed
I LOVE NTR - NARITA TOP ROAD
0 parents  commit dd10af1

23 files changed

+2906
-0
lines changed

.github/workflows/01.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: init banner
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# You can change this CRON syntax to customize execute interval
7+
- cron: "0 */3 * * *"
8+
9+
10+
permissions:
11+
contents: write
12+
actions: write
13+
14+
jobs:
15+
init:
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub Token for CLI
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub Token for Actions
22+
FB_TOKEN: ${{ secrets.FB_TOKEN }} # Facebook Token
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4.2.2
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5.4.0
30+
with:
31+
python-version: "3.13"
32+
33+
# checa se o workflow já está rodando, atribui o valor para a variável IS_RUNNING
34+
- name: Is it already running?
35+
run: |
36+
WORKFLOW_NAME="${{ github.workflow }}"
37+
RUN_COUNT=$(gh run list --status=in_progress --json name |
38+
jq "[.[] | select(.name == \"$WORKFLOW_NAME\")] | length")
39+
40+
if [ "$RUN_COUNT" -gt 1 ]; then
41+
echo "The workflow init banner is already running"
42+
echo "IS_RUNNING=true" >> $GITHUB_ENV
43+
else
44+
echo "IS_RUNNING=false" >> $GITHUB_ENV
45+
fi
46+
47+
# checa se o episódio está disponível, se não, sai do workflow com erro
48+
# - name: Check if episode is available
49+
# run: |
50+
51+
52+
# cache de dependencias
53+
- name: Cache dependencies
54+
uses: actions/cache@v4.2.0
55+
with:
56+
path: ~/.cache/pip
57+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
58+
restore-keys: |
59+
${{ runner.os }}-pip-
60+
${{ runner.os }}-
61+
62+
# instala dependencias
63+
- name: Install dependencies
64+
run: |
65+
python -m pip install --upgrade pip
66+
pip install -r requirements.txt
67+
68+
# So roda o main.py se o workflow não estiver rodando
69+
- name: Main
70+
run: |
71+
if [[ "$IS_RUNNING" == "false" ]]; then
72+
python main.py
73+
fi
74+
75+
76+
# atualiza variaveis que serão usadas no próximo workflow
77+
- name: Commit changes
78+
uses: stefanzweifel/git-auto-commit-action@v5
79+
with:
80+
file_pattern: "logs/* configs.yml"
81+
commit_message: "Update"
82+
commit_user_name: "GitHub Actions"
83+
commit_user_email: "actions@github.com"
84+
commit_author: "GitHub Actions <actions@github.com>"
85+
skip_dirty_check: true

.github/workflows/02.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: check variables
2+
3+
on:
4+
push:
5+
paths:
6+
- "subtitles/**"
7+
- "configs.yml"
8+
9+
10+
jobs:
11+
check-variables:
12+
runs-on: ubuntu-latest
13+
14+
env:
15+
FB_TOKEN: ${{ secrets.FB_TOKEN }}
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4.2.2
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5.4.0
23+
with:
24+
python-version: "3.13"
25+
26+
# cache de dependencias
27+
- name: Cache dependencies
28+
uses: actions/cache@v4.2.0
29+
with:
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-
34+
${{ runner.os }}-
35+
36+
# instala dependencias
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r requirements.txt
41+
42+
- name: Run FB Token Check
43+
run: |
44+
python -m src.variable_check

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
venv/
2+
__pycache__/
3+
*/__pycache__/
4+
*.pyc
5+
*.pyo
6+
*.pyd
7+
*.pyw
8+
*.pyz
9+
10+
11+
.vscode/
12+
.env
13+
test.py
14+
pyproject.toml
15+
images/*/
16+
temp/*/
17+
logs/*/
18+
temp/*/

configs.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
github:
2+
username: JavaRaf # Your GitHub username (format: string)
3+
repo: TOP-ROAD-FRAMES # The name of the repo where the episodes which the frames are stored
4+
branch: master # The branch of the repo where the episodes which the frames are stored
5+
# Example:
6+
# javaRafa/ # username
7+
# └── frames/ # repo name
8+
# └── 01/ # episode folder name (name of the episode folder) (ex: 01, 02, 03, etc.)
9+
# ├── frame_0001.jpg
10+
# ├── frame_0002.jpg
11+
# └── frame_0003.jpg
12+
13+
14+
# progress
15+
in_progress:
16+
season: 1
17+
episode: 1
18+
frame: 0
19+
20+
21+
22+
episodes:
23+
1:
24+
title: The Beginning of a Dream # title for the episode (optional)
25+
image_fps: 3.5 # frames per second of the image/video (necessary to know when to stop posting)
26+
max_frames: 15 # maximum frames in the episode (exigid to know when to stop posting)
27+
album_id: # album id for repost frames in a facebook album (optional)
28+
2:
29+
title: The Stage of Glory # title for the episode (optional)
30+
image_fps: 3.5 # frames per second of the image/video (necessary to know when to stop posting)
31+
max_frames: 15 # maximum frames in the episode (exigid to know when to stop posting)
32+
album_id: # album id for repost frames in a facebook album (optional)
33+
3:
34+
title: The Reason to Run # title for the episode (optional)
35+
image_fps: 3.5 # frames per second of the image/video (necessary to know when to stop posting)
36+
max_frames: 15 # maximum frames in the episode (exigid to know when to stop posting)
37+
album_id: # album id for repost frames in a facebook album (optional)
38+
4:
39+
title: One Mind # title for the episode (optional)
40+
image_fps: 3.5 # frames per second of the image/video (necessary to know when to stop posting)
41+
max_frames: 15 # maximum frames in the episode (exigid to know when to stop posting)
42+
album_id: # album id for repost frames in a facebook album (optional)
43+
44+
45+
46+
posting:
47+
fph: 15 # Frames posted per cicle (format: integer)
48+
posting_interval: 2 # Interval between posts in minutes (recomended: 2 or more)(format: integer)
49+
posting_subtitles: true # If true, the subtitles will be posted on comments (format: boolean)
50+
reposting_in_album: true # If true, the frame will be reposted in an album (format: boolean)
51+
52+
random_crop: # Random crop settings (optional)
53+
enabled: true # If true, the image will be cropped randomly and posted on comments (default: true) (format: boolean)
54+
min_x: 200 # Minimum crop width (default: 200) (format: integer)
55+
min_y: 600 # Minimum crop height (default: 600) (format: integer)
56+
57+
58+
59+
60+
61+
62+
63+
64+
65+
# placeholders:
66+
# {season_number} The season number
67+
# {episode_number} The episode number
68+
# {frame_number} The frame number
69+
# {max_frames} The maximum frames in the episode
70+
# {img_fps} The frames per second of the image/video
71+
# {fph} The frames per hour
72+
73+
# {timestamp} The timestamp of the frame
74+
# {subtitles} The subtitles of the frame
75+
# {episode_title} The title of the episode
76+
# {posting_interval} The interval between posts in minutes (default: 2) (alterable in the configs.yml file)
77+
# {execution_interval} The interval between execution (default: 2 hours) (alterable in the workflow file)
78+
post_msg: |
79+
{episode_title} - Episode {episode_number}, Frame {frame_number} out of {max_frames}
80+
timestamp: {timestamp}
81+
82+
bio_msg: |
83+
Posting {fph} frames every {execution_interval} hours
84+

images/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Images
2+
3+
This directory is used to temporarily store images that will be posted on Facebook. It serves as a staging area for organizing and preparing visual content.
4+
5+
## Purpose
6+
7+
- Temporary storage for images
8+
- Organizing visual content
9+
- Preparing content for posting

logs/app.log

Whitespace-only changes.

logs/fb_log.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)