Skip to content

Commit 798bbbc

Browse files
authored
[BACKEND] Windows support (#476)
1 parent a2808fa commit 798bbbc

29 files changed

Lines changed: 438 additions & 156 deletions

.github/workflows/ci-windows.yaml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: ytld-sub CI (Windows)
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
jobs:
11+
test-unit:
12+
runs-on: windows-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: "3.10"
23+
24+
- name: Run unit tests with coverage
25+
run: |
26+
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
27+
tar -xf ffmpeg.zip
28+
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
29+
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
30+
31+
python -m pip install -e .[test]
32+
python -m pytest tests/unit
33+
34+
test-soundcloud:
35+
runs-on: windows-latest
36+
permissions:
37+
contents: read
38+
39+
steps:
40+
- uses: actions/checkout@v3
41+
42+
- name: Set up Python
43+
uses: actions/setup-python@v4
44+
with:
45+
python-version: "3.10"
46+
47+
- name: Run e2e soundcloud tests with coverage
48+
run: |
49+
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
50+
tar -xf ffmpeg.zip
51+
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
52+
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
53+
54+
python -m pip install -e .[test]
55+
python -m pytest tests/e2e/soundcloud
56+
57+
test-bandcamp:
58+
runs-on: windows-latest
59+
permissions:
60+
contents: read
61+
62+
steps:
63+
- uses: actions/checkout@v3
64+
65+
- name: Set up Python
66+
uses: actions/setup-python@v4
67+
with:
68+
python-version: "3.10"
69+
70+
- name: Run e2e soundcloud tests with coverage
71+
run: |
72+
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
73+
tar -xf ffmpeg.zip
74+
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
75+
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
76+
77+
python -m pip install -e .[test]
78+
python -m pytest tests/e2e/bandcamp
79+
80+
81+
test-youtube:
82+
runs-on: windows-latest
83+
permissions:
84+
contents: read
85+
86+
steps:
87+
- uses: actions/checkout@v3
88+
89+
- name: Set up Python
90+
uses: actions/setup-python@v4
91+
with:
92+
python-version: "3.10"
93+
94+
- name: Run e2e youtube tests with coverage
95+
run: |
96+
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
97+
tar -xf ffmpeg.zip
98+
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
99+
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
100+
101+
python -m pip install -e .[test]
102+
python -m pytest tests/e2e/youtube
103+
104+
test-plugins:
105+
runs-on: windows-latest
106+
permissions:
107+
contents: read
108+
109+
steps:
110+
- uses: actions/checkout@v3
111+
112+
- name: Set up Python
113+
uses: actions/setup-python@v4
114+
with:
115+
python-version: "3.10"
116+
117+
- name: Run e2e plugin tests with coverage
118+
run: |
119+
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
120+
tar -xf ffmpeg.zip
121+
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
122+
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
123+
124+
python -m pip install -e .[test]
125+
python -m pytest tests/e2e/plugins

.github/workflows/ci.yaml

Lines changed: 25 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ytld-sub CI
1+
name: ytld-sub CI (Linux)
22

33
on:
44
pull_request:
@@ -8,70 +8,42 @@ on:
88
branches:
99
- master
1010
jobs:
11-
test-build:
12-
runs-on: ubuntu-22.04
13-
strategy:
14-
matrix:
15-
python-version: ["3.10"]
16-
steps:
17-
- uses: actions/checkout@v3
18-
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
24-
- name: Install dependencies
25-
run: |
26-
python -m venv /opt/env
27-
source /opt/env/bin/activate
28-
pip install -e .[lint,test]
29-
- name: Save Python build cache
30-
uses: actions/cache@v3
31-
with:
32-
path: /opt/env
33-
key: ${{github.sha}}-env
34-
3511
test-lint:
3612
runs-on: ubuntu-22.04
37-
needs: test-build
3813
permissions:
3914
contents: read
4015

4116
steps:
4217
- uses: actions/checkout@v3
4318

44-
- name: Restore Python build cache
45-
uses: actions/cache@v3
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
4621
with:
47-
path: /opt/env
48-
key: ${{github.sha}}-env
22+
python-version: "3.10"
4923

5024
- name: Run linters
5125
run: |
52-
source /opt/env/bin/activate
26+
pip install -e .[lint]
5327
make check_lint
5428
5529
test-unit:
5630
runs-on: ubuntu-22.04
57-
needs: test-build
5831
permissions:
5932
contents: read
6033

6134
steps:
6235
- uses: actions/checkout@v3
6336

64-
- name: Restore Python build cache
65-
uses: actions/cache@v3
37+
- name: Set up Python
38+
uses: actions/setup-python@v4
6639
with:
67-
path: /opt/env
68-
key: ${{github.sha}}-env
40+
python-version: "3.10"
6941

7042
- name: Run unit tests with coverage
7143
run: |
44+
pip install -e .[test]
7245
sudo apt-get update
7346
sudo apt-get install -y ffmpeg
74-
source /opt/env/bin/activate
7547
coverage run -m pytest tests/unit && coverage xml -o /opt/coverage/unit/coverage.xml
7648
7749
- name: Save coverage
@@ -82,46 +54,42 @@ jobs:
8254

8355
test-soundcloud:
8456
runs-on: ubuntu-22.04
85-
needs: test-build
8657
permissions:
8758
contents: read
8859

8960
steps:
9061
- uses: actions/checkout@v3
9162

92-
- name: Restore Python build cache
93-
uses: actions/cache@v3
63+
- name: Set up Python
64+
uses: actions/setup-python@v4
9465
with:
95-
path: /opt/env
96-
key: ${{github.sha}}-env
66+
python-version: "3.10"
9767

9868
- name: Run e2e soundcloud tests with coverage
9969
run: |
70+
pip install -e .[test]
10071
sudo apt-get update
10172
sudo apt-get install -y ffmpeg
102-
source /opt/env/bin/activate
10373
coverage run -m pytest tests/e2e/soundcloud && coverage xml -o /opt/coverage/soundcloud/coverage.xml
10474
10575
test-bandcamp:
10676
runs-on: ubuntu-22.04
107-
needs: test-build
10877
permissions:
10978
contents: read
11079

11180
steps:
11281
- uses: actions/checkout@v3
11382

114-
- name: Restore Python build cache
115-
uses: actions/cache@v3
83+
- name: Set up Python
84+
uses: actions/setup-python@v4
11685
with:
117-
path: /opt/env
118-
key: ${{github.sha}}-env
86+
python-version: "3.10"
11987

12088
- name: Run e2e soundcloud tests with coverage
12189
run: |
90+
pip install -e .[test]
12291
sudo apt-get update
12392
sudo apt-get install -y ffmpeg
124-
source /opt/env/bin/activate
12593
coverage run -m pytest tests/e2e/bandcamp && coverage xml -o /opt/coverage/bandcamp/coverage.xml
12694
12795
- name: Save coverage
@@ -132,24 +100,22 @@ jobs:
132100

133101
test-youtube:
134102
runs-on: ubuntu-22.04
135-
needs: test-build
136103
permissions:
137104
contents: read
138105

139106
steps:
140107
- uses: actions/checkout@v3
141108

142-
- name: Restore Python build cache
143-
uses: actions/cache@v3
109+
- name: Set up Python
110+
uses: actions/setup-python@v4
144111
with:
145-
path: /opt/env
146-
key: ${{github.sha}}-env
112+
python-version: "3.10"
147113

148114
- name: Run e2e youtube tests with coverage
149115
run: |
116+
pip install -e .[test]
150117
sudo apt-get update
151118
sudo apt-get install -y ffmpeg
152-
source /opt/env/bin/activate
153119
coverage run -m pytest tests/e2e/youtube && coverage xml -o /opt/coverage/youtube/coverage.xml
154120
155121
- name: Save coverage
@@ -160,24 +126,22 @@ jobs:
160126

161127
test-plugins:
162128
runs-on: ubuntu-22.04
163-
needs: test-build
164129
permissions:
165130
contents: read
166131

167132
steps:
168133
- uses: actions/checkout@v3
169134

170-
- name: Restore Python build cache
171-
uses: actions/cache@v3
135+
- name: Set up Python
136+
uses: actions/setup-python@v4
172137
with:
173-
path: /opt/env
174-
key: ${{github.sha}}-env
138+
python-version: "3.10"
175139

176140
- name: Run e2e plugin tests with coverage
177141
run: |
142+
pip install -e .[test]
178143
sudo apt-get update
179144
sudo apt-get install -y ffmpeg
180-
source /opt/env/bin/activate
181145
coverage run -m pytest tests/e2e/plugins && coverage xml -o /opt/coverage/plugins/coverage.xml
182146
183147
- name: Save coverage

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,7 @@ docker/*.whl
142142
docker/root/*.whl
143143
docker/root/defaults/examples
144144

145-
.local/
145+
.local/
146+
147+
ffmpeg.exe
148+
ffprobe.exe

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ maximum flexibility while maintaining simplicity.
3434
![jelly_mv](https://user-images.githubusercontent.com/10107080/182677256-43aeb029-0c3f-4648-9fd2-352b9666b262.PNG)
3535

3636
### SoundCloud Albums and Singles
37-
#### MusicBee (any file or tag-based music player)
37+
#### MusicBee (any file or tag-based music players)
3838
![sc_mb](https://user-images.githubusercontent.com/10107080/182685415-06adf477-3dd3-475d-bbcd-53b0152b9f0a.PNG)
3939

4040
### Bandcamp Discography
41-
#### Navidrome (any file or tag-based music server)
41+
#### Navidrome (any file or tag-based music servers)
4242
![bc_nav](https://user-images.githubusercontent.com/10107080/212503861-1d8748e6-6f6d-4043-b543-84226cd1f662.png)
4343

4444

@@ -285,7 +285,7 @@ docker run -d \
285285
Download and use our latest executable using the command below. For Windows users, use this method in
286286
[WSL](https://learn.microsoft.com/en-us/windows/wsl/). FFmpeg is a required dependency.
287287
```commandline
288-
curl -L https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub > ytdl-sub
288+
curl -L -o ytdl-sub https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub
289289
chmod +x ytdl-sub
290290
./ytdl-sub -h
291291
```

0 commit comments

Comments
 (0)