Skip to content

Commit

Permalink
env
Browse files Browse the repository at this point in the history
  • Loading branch information
moyada committed Feb 18, 2024
1 parent 83a3139 commit db9fd9f
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 6 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
- linux/arm/v7
steps:

- name: Checkout
Expand All @@ -36,5 +42,15 @@ jobs:
with:
context: .
push: true
file: ./Dockerfile
tags: xueyikang/stealer
platforms: linux/amd64,linux/arm64

- name: Build and Push Docker arm image
uses: docker/build-push-action@v5
with:
context: .
push: true
file: ./Dockerfile_ARM
tags: xueyikang/stealer
platforms: linux/amd64,linux/arm64
platform: linux/arm/v7
23 changes: 23 additions & 0 deletions Dockerfile_ARM
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.8.18-slim

ENV PYTHONUNBUFFERED 1

RUN apt-get update && apt-get upgrade -y && apt-get install -y gcc && apt-get install -y ffmpeg

# 更新pip
RUN pip install --upgrade pip --index-url http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

# 工作目录
WORKDIR /app
ADD . /app

# pip安装依赖包
RUN pip install -r requirements.txt --index-url http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# 打开容器的8000端口
EXPOSE 8000

# 执行命令行,启动django服务
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
14 changes: 12 additions & 2 deletions core/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
from django.shortcuts import redirect, render

import core
from core import config
from core.model import ErrorResult
from route import controller
from core.type import Video
import core.config


def index(request):
Expand All @@ -14,8 +16,16 @@ def index(request):
})


def ip(request):
return redirect('http://httpbin.org/ip')
def set_env(request):
key = request.GET.get('key')
if not key:
return HttpResponseBadRequest(ErrorResult.TYPE_NOT_PRESENT.get_data())
value = request.GET.get('value')
if not value:
return HttpResponseBadRequest(ErrorResult.TYPE_NOT_PRESENT.get_data())

if key == "bilibili":
config.bilibili_cookie = value


def fetch(request):
Expand Down
2 changes: 1 addition & 1 deletion service/douyin.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get_info(cls, url: str) -> Result:
info.cover = DouyinService.get_cover(data)

# if data['aweme_type'] is not 0:
if data['images'] is not None :
if data['images'] is not None:
info.images = DouyinService.get_image(data)
info.filename = data['aweme_id'] + ".zip"
else:
Expand Down
2 changes: 1 addition & 1 deletion stealer/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# path('admin/', admin.site.urls),
path('', TemplateView.as_view(template_name="index.html"), name='index'),
# path('', index.index, name='index'),
path('ip/', apis.ip, name='ip'),
# path('set_env', apis.set_env, name='set_env'),
path('video/', include('core.urls'), name='video'),
]

Expand Down

0 comments on commit db9fd9f

Please sign in to comment.