This commit is contained in:
Guillem Hernandez Sola
2026-06-30 16:03:46 +02:00
parent 47fb59e367
commit 9354c99f00
11 changed files with 176 additions and 701 deletions

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,44 +43,19 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,91 +43,23 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }
// ─────────────────────────────────────────────
// 3. Run the bot
// ─────────────────────────────────────────────
stage('Run Script') {
steps {
withCredentials([
string(
credentialsId: 'TIKTOK_BETEVE_HANDLE',
variable: 'TIKTOK_BETEVE_HANDLE'
),
string(
credentialsId: 'BSKY_BETEVE_HANDLE',
variable: 'BSKY_BETEVE_HANDLE'
),
string(
credentialsId: 'BSKY_BETEVE_APP_PASSWORD',
variable: 'BSKY_BETEVE_APP_PASSWORD'
),
file(
credentialsId: 'TIKTOK_COOKIES_JSON',
variable: 'TIKTOK_COOKIES_FILE'
)
]) {
sh '''
set -e
# Inject the secret cookies file into the workspace
cp "$TIKTOK_COOKIES_FILE" tiktok_cookies.json
. venv/bin/activate
python3 tiktok2bsky.py \
--tiktok-handle "$TIKTOK_BETEVE_HANDLE" \
--bsky-handle "$BSKY_BETEVE_HANDLE" \
--bsky-app-password "$BSKY_BETEVE_APP_PASSWORD" \
--bsky-base-url https://eurosky.social \
--bsky-langs ca \
--cookies-path tiktok_cookies.json
'''
}
}
}
}
// ───────────────────────────────────────────── // ─────────────────────────────────────────────
// Post actions // Post actions
// ───────────────────────────────────────────── // ─────────────────────────────────────────────

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,91 +43,23 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }
// ─────────────────────────────────────────────
// 3. Run the bot
// ─────────────────────────────────────────────
stage('Run Script') {
steps {
withCredentials([
string(
credentialsId: 'TIKTOK_BTVESPORTS_HANDLE',
variable: 'TIKTOK_BTVESPORTS_HANDLE'
),
string(
credentialsId: 'BSKY_BETEVE_HANDLE',
variable: 'BSKY_BETEVE_HANDLE'
),
string(
credentialsId: 'BSKY_BETEVE_APP_PASSWORD',
variable: 'BSKY_BETEVE_APP_PASSWORD'
),
file(
credentialsId: 'TIKTOK_COOKIES_JSON',
variable: 'TIKTOK_COOKIES_FILE'
)
]) {
sh '''
set -e
# Inject the secret cookies file into the workspace
cp "$TIKTOK_COOKIES_FILE" tiktok_cookies.json
. venv/bin/activate
python3 tiktok2bsky.py \
--tiktok-handle "$TIKTOK_BTVESPORTS_HANDLE" \
--bsky-handle "$BSKY_BETEVE_HANDLE" \
--bsky-app-password "$BSKY_BETEVE_APP_PASSWORD" \
--bsky-base-url https://eurosky.social \
--bsky-langs ca \
--cookies-path tiktok_cookies.json
'''
}
}
}
}
// ───────────────────────────────────────────── // ─────────────────────────────────────────────
// Post actions // Post actions
// ───────────────────────────────────────────── // ─────────────────────────────────────────────

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,91 +43,22 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }
// ─────────────────────────────────────────────
// 3. Run the bot
// ─────────────────────────────────────────────
stage('Run Script') {
steps {
withCredentials([
string(
credentialsId: 'TIKTOK_BTVNOTICIES_HANDLE',
variable: 'TIKTOK_BTVNOTICIES_HANDLE'
),
string(
credentialsId: 'BSKY_BETEVE_HANDLE',
variable: 'BSKY_BETEVE_HANDLE'
),
string(
credentialsId: 'BSKY_BETEVE_APP_PASSWORD',
variable: 'BSKY_BETEVE_APP_PASSWORD'
),
file(
credentialsId: 'TIKTOK_COOKIES_JSON',
variable: 'TIKTOK_COOKIES_FILE'
)
]) {
sh '''
set -e
# Inject the secret cookies file into the workspace
cp "$TIKTOK_COOKIES_FILE" tiktok_cookies.json
. venv/bin/activate
python3 tiktok2bsky.py \
--tiktok-handle "$TIKTOK_BTVNOTICIES_HANDLE" \
--bsky-handle "$BSKY_BETEVE_HANDLE" \
--bsky-app-password "$BSKY_BETEVE_APP_PASSWORD" \
--bsky-base-url https://eurosky.social \
--bsky-langs ca \
--cookies-path tiktok_cookies.json
'''
}
}
}
}
// ───────────────────────────────────────────── // ─────────────────────────────────────────────
// Post actions // Post actions
// ───────────────────────────────────────────── // ─────────────────────────────────────────────

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,91 +43,23 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }
// ─────────────────────────────────────────────
// 3. Run the bot
// ─────────────────────────────────────────────
stage('Run Script') {
steps {
withCredentials([
string(
credentialsId: 'TIKTOK_COMEDYGOLDBCN_HANDLE',
variable: 'TIKTOK_COMEDYGOLDBCN_HANDLE'
),
string(
credentialsId: 'BSKY_COMEDYGOLDBCN_HANDLE',
variable: 'BSKY_COMEDYGOLDBCN_HANDLE'
),
string(
credentialsId: 'BSKY_COMEDYGOLDBCN_APP_PASSWORD',
variable: 'BSKY_COMEDYGOLDBCN_APP_PASSWORD'
),
file(
credentialsId: 'TIKTOK_COOKIES_JSON',
variable: 'TIKTOK_COOKIES_FILE'
)
]) {
sh '''
set -e
# Inject the secret cookies file into the workspace
cp "$TIKTOK_COOKIES_FILE" tiktok_cookies.json
. venv/bin/activate
python3 tiktok2bsky.py \
--tiktok-handle "$TIKTOK_COMEDYGOLDBCN_HANDLE" \
--bsky-handle "$BSKY_COMEDYGOLDBCN_HANDLE" \
--bsky-app-password "$BSKY_COMEDYGOLDBCN_APP_PASSWORD" \
--bsky-base-url https://bsky.social \
--bsky-langs ca \
--cookies-path tiktok_cookies.json
'''
}
}
}
}
// ───────────────────────────────────────────── // ─────────────────────────────────────────────
// Post actions // Post actions
// ───────────────────────────────────────────── // ─────────────────────────────────────────────

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,44 +43,19 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,44 +43,19 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,44 +43,19 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,44 +43,19 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,44 +43,19 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }

View File

@@ -14,32 +14,25 @@ pipeline {
stages { stages {
// ─────────────────────────────────────────────
// 1. Checkout
// ─────────────────────────────────────────────
stage('Checkout Code') { stage('Checkout Code') {
steps { steps {
checkout scm checkout scm
} }
} }
// ─────────────────────────────────────────────
// 2. Python env + dependencies
// ─────────────────────────────────────────────
stage('Setup Python & Install Dependencies') { stage('Setup Python & Install Dependencies') {
steps { steps {
sh ''' sh '''
set -e set -e
cd "$WORKSPACE"
# ── Create venv ──────────────────────────────────── # Crea el venv
python3 -m venv venv python3 -m venv venv
# ── Upgrade pip toolchain ────────────────────────── # Usa sempre python3 -m pip, mai el binari pip directament
. venv/bin/activate "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools
pip install --upgrade pip wheel setuptools
# ── Core dependencies ────────────────────────────── "$WORKSPACE/venv/bin/python3" -m pip install -U \
pip install -U \
atproto \ atproto \
playwright \ playwright \
playwright-stealth \ playwright-stealth \
@@ -50,44 +43,19 @@ pipeline {
beautifulsoup4 \ beautifulsoup4 \
charset-normalizer \ charset-normalizer \
Pillow \ Pillow \
grapheme grapheme \
yt-dlp \
curl-cffi
# ── yt-dlp: always upgrade to latest ────────────── # Sanity checks
# TikTok extractor breaks frequently — latest is required "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')"
pip install --upgrade yt-dlp "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')"
pip show yt-dlp | grep -E "^(Name|Version)" "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')"
"$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')"
# ── curl_cffi: TikTok impersonation (REQUIRED) ───── # Playwright browser binaries
# Without this yt-dlp cannot bypass TikTok bot detection PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \
pip install --upgrade curl-cffi "$WORKSPACE/venv/bin/python3" -m playwright install chromium
pip show curl-cffi | grep -E "^(Name|Version)"
python3 -c "import curl_cffi; print('curl_cffi OK')"
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
playwright install chromium
''' '''
} }
} }