Skip to content

Commit e3f5b66

Browse files
committed
env
1 parent afdd14b commit e3f5b66

5 files changed

Lines changed: 55 additions & 6 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ jobs:
1313
build:
1414

1515
runs-on: ubuntu-latest
16-
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
platform:
20+
- linux/amd64
21+
- linux/arm64
22+
- linux/arm/v7
1723
steps:
1824

1925
- name: Checkout
@@ -36,5 +42,15 @@ jobs:
3642
with:
3743
context: .
3844
push: true
45+
file: ./Dockerfile
46+
tags: xueyikang/stealer
47+
platforms: linux/amd64,linux/arm64
48+
49+
- name: Build and Push Docker arm image
50+
uses: docker/build-push-action@v5
51+
with:
52+
context: .
53+
push: true
54+
file: ./Dockerfile_ARM
3955
tags: xueyikang/stealer
40-
platforms: linux/amd64,linux/arm64
56+
platform: linux/arm/v7

Dockerfile_ARM

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM python:3.8.18-slim
2+
3+
ENV PYTHONUNBUFFERED 1
4+
5+
RUN apt-get update && apt-get upgrade -y && apt-get install -y gcc && apt-get install -y ffmpeg
6+
7+
# 更新pip
8+
RUN pip install --upgrade pip --index-url http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
9+
10+
# 工作目录
11+
WORKDIR /app
12+
ADD . /app
13+
14+
# pip安装依赖包
15+
RUN pip install -r requirements.txt --index-url http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
16+
17+
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
18+
19+
# 打开容器的8000端口
20+
EXPOSE 8000
21+
22+
# 执行命令行,启动django服务
23+
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

core/apis.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
from django.shortcuts import redirect, render
44

55
import core
6+
from core import config
67
from core.model import ErrorResult
78
from route import controller
89
from core.type import Video
10+
import core.config
911

1012

1113
def index(request):
@@ -14,8 +16,16 @@ def index(request):
1416
})
1517

1618

17-
def ip(request):
18-
return redirect('http://httpbin.org/ip')
19+
def set_env(request):
20+
key = request.GET.get('key')
21+
if not key:
22+
return HttpResponseBadRequest(ErrorResult.TYPE_NOT_PRESENT.get_data())
23+
value = request.GET.get('value')
24+
if not value:
25+
return HttpResponseBadRequest(ErrorResult.TYPE_NOT_PRESENT.get_data())
26+
27+
if key == "bilibili":
28+
config.bilibili_cookie = value
1929

2030

2131
def fetch(request):

service/douyin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def get_info(cls, url: str) -> Result:
8383
info.cover = DouyinService.get_cover(data)
8484

8585
# if data['aweme_type'] is not 0:
86-
if data['images'] is not None :
86+
if data['images'] is not None:
8787
info.images = DouyinService.get_image(data)
8888
info.filename = data['aweme_id'] + ".zip"
8989
else:

stealer/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# path('admin/', admin.site.urls),
2424
path('', TemplateView.as_view(template_name="index.html"), name='index'),
2525
# path('', index.index, name='index'),
26-
path('ip/', apis.ip, name='ip'),
26+
# path('set_env', apis.set_env, name='set_env'),
2727
path('video/', include('core.urls'), name='video'),
2828
]
2929

0 commit comments

Comments
 (0)