Open Insomnia731 opened 1 month ago
@Insomnia731 instead of using bot in your phone use a free python hosting
@Insomnia731 instead of using bot in your phone use a free python hosting
Can you recommend me one? Pythonanywhere doesn't connect to the hamster site, and they generally have a white list of the Internet sites.
@Insomnia731 you can use GitHub Actions to keep it running or use huggingface spaces
You can host it in Koyeb.com refer #2249
@Insomnia731 you can use GitHub Actions to keep it running or use huggingface spaces
Can you elaborate on how to host it using Github Actions(is it free?).
Yes it's free. Clone this repo and add main.yml file in .github/workflows folder. Aslo edit .env and add sessions folder with session file inside it.
main.yml:
name: Hamster Kombat Bot
on:
workflow_dispatch:
schedule:
- cron: '10 */6 * * *' # Runs at the 10th minute of every 6-hour interval
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc build-essential libssl-dev --no-install-recommends
sudo rm -rf /var/lib/apt/lists/*
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Playwright and Chromium
run: |
python -m playwright install --with-deps chromium
sudo rm -rf /var/lib/apt/lists/*
- name: Run Hamster Kombat Bot
run: python main.py -a 2
Yes it's free. Clone this repo and add main.yml file in .github/workflows folder. Aslo edit .env and add sessions folder with session file inside it.
- name: Install Playwright and Chromium run: | python -m playwright install --with-deps chromium sudo rm -rf /var/lib/apt/lists/*
Thank you for the hints, but I don't understand why these lines with chromium are needed to launch hamster? And they give an error during installation, git probably doesn't support this.
python -m playwright install --with-deps chromium
Okay remove those lines. main.yml: ` name: Hamster Kombat Bot
on: workflow_dispatch: schedule:
jobs: run-script: runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc build-essential libssl-dev --no-install-recommends
sudo rm -rf /var/lib/apt/lists/*
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Hamster Kombat Bot
run: python main.py -a 2
`
Сначала при установке было error: can't find Rust compiler, поставил раст, там где была проблема, а именно вот на этом этапе: _Using cached pydanticcore-2.20.1.tar.gz (388 kB) Installing build dependencies И здесь появлялась эта самая ошибка, теперь на этом месте просто бесконечное ожидание. Подскажите как фиксить.