yt-dlp 2.7.2

๐ŸŽฌ๏ธ A Rust library (with auto dependencies installation) for Youtube downloading
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
name: "๐Ÿ”Œ Github CI - Development"

on:
  push:
    branches: [ develop, master ]
  pull_request:
    branches: [ develop, master ]
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  scorecard-analysis:
    name: ๐Ÿ” Scorecard analysis
    if: github.event_name == 'push'
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      id-token: write
      pull-requests: read
      contents: read
      actions: read
      issues: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          persist-credentials: false

      - name: ๐Ÿ” Scan with Scorecard
        uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
        with:
          results_file: results.sarif
          results_format: sarif
          publish_results: true
          repo_token: ${{ secrets.GITHUB_TOKEN }}

      - name: ๐Ÿ“ฆ Upload Scorecard scan results artifact
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
        with:
          name: sarif-results
          path: results.sarif
          retention-days: 5

      - name: ๐Ÿ“ฆ Upload Scorecard scan results to GitHub dashboard
        uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
        with:
          sarif_file: results.sarif

  fossa:
    name: ๐Ÿ“œ FOSSA license scan
    if: github.event_name == 'push'
    runs-on: ubuntu-latest
    permissions:
      contents: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: ๐Ÿ“œ Run FOSSA scan
        uses: fossas/fossa-action@ff70fe9fe17cbd2040648f1c45e8ec4e4884dcf3 # v1.9.0
        with:
          api-key: ${{ secrets.FOSSA_API_KEY }}

  sonarcloud-analysis:
    name: ๐Ÿ” SonarCloud analysis
    if: github.event_name == 'push'
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          fetch-depth: 0
          persist-credentials: false

      - name: ๐Ÿ” Scan with SonarCloud
        uses: SonarSource/sonarqube-scan-action@299e4b793aaa83bf2aba7c9c14bedbb485688ec4 # v7.1.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

  dependency-review:
    name: ๐Ÿ“ฆ Dependency review
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    permissions:
      contents: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: ๐Ÿ“ฆ Review dependencies
        uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0

  check-spell:
    name: ๐Ÿ“ Check spelling
    runs-on: ubuntu-latest
    permissions:
      contents: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: ๐Ÿ“ Check spelling
        uses: crate-ci/typos@02ea592e44b3a53c302f697cddca7641cd051c3d # v1.45.0

  check-format:
    name: ๐Ÿ’„ Check formatting
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    permissions:
      contents: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: ๐Ÿ› ๏ธ Set up nightly Rust (for rustfmt)
        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # nightly
        with:
          toolchain: nightly
          components: rustfmt

      - name: ๐Ÿ’„ Check formatting
        run: cargo +nightly fmt --all -- --check

  build-and-test:
    name: ๐Ÿฆ€ Build & Test
    runs-on: ubuntu-latest
    needs: [check-spell]
    env:
      CLICOLOR: 1
      SCCACHE_GHA_ENABLED: "true"
      RUSTC_WRAPPER: "sccache"
      REDIS_URL: redis://localhost:6379
    permissions:
      contents: read
    services:
      redis:
        image: redis:7-alpine
        ports:
          - 6379:6379
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: ๐Ÿ“ฆ Set up sccache
        uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
        with:
          disable_annotations: true

      - name: ๐Ÿ“ฆ Cache Rust registry
        uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
        with:
          shared-key: "full"
          cache-targets: false

      - name: ๐Ÿ“ฆ Restore compiled dependencies
        uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
        with:
          path: target/
          key: target-full-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: target-full-${{ runner.os }}-

      - name: ๐Ÿ› ๏ธ Set up Rust toolchain
        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
        with:
          components: clippy

      - name: ๐Ÿฆ€ Check with Clippy
        run: cargo clippy --workspace --all-features -- -D warnings

      - name: ๐Ÿงช Run unit tests
        run: cargo test --test unit --all-features

      - name: ๐Ÿ”— Run integration tests
        run: cargo test --test integration --all-features

  doc-tests:
    name: ๐Ÿ“š Test docs
    needs: [check-spell]
    runs-on: ubuntu-latest
    env:
      CLICOLOR: 1
      SCCACHE_GHA_ENABLED: "true"
      RUSTC_WRAPPER: "sccache"
    permissions:
      contents: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: ๐Ÿ“ฆ Set up sccache
        uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
        with:
          disable_annotations: true

      - name: ๐Ÿ“ฆ Cache Rust registry
        uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
        with:
          shared-key: "full"
          cache-targets: false

      - name: ๐Ÿ“ฆ Restore compiled dependencies
        uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
        with:
          path: target/
          key: target-full-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: target-full-${{ runner.os }}-

      - name: ๐Ÿ› ๏ธ Set up Rust toolchain
        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable

      - name: ๐Ÿ“š Run doc tests
        run: cargo test --doc --workspace --all-features

  e2e-tests:
    name: ๐Ÿš€ E2E tests
    needs: [build-and-test, doc-tests]
    runs-on: ubuntu-latest
    env:
      CLICOLOR: 1
      SCCACHE_GHA_ENABLED: "true"
      RUSTC_WRAPPER: "sccache"
    permissions:
      contents: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: ๐Ÿ“ฆ Set up sccache
        uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
        with:
          disable_annotations: true

      - name: ๐Ÿ“ฆ Cache Rust registry
        uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
        with:
          shared-key: "full"
          cache-targets: false

      - name: ๐Ÿ“ฆ Restore compiled dependencies
        uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
        with:
          path: target/
          key: target-full-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: target-full-${{ runner.os }}-

      - name: ๐Ÿ› ๏ธ Set up Rust toolchain
        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable

      - name: ๐Ÿ› ๏ธ Install ffmpeg from boul2gom/ffmpeg-builds
        run: |
          curl -fsSL "https://github.com/boul2gom/ffmpeg-builds/releases/latest/download/ffmpeg-linux-x64.zip" -o /tmp/ffmpeg.zip
          mkdir -p /opt/ffmpeg
          unzip -j /tmp/ffmpeg.zip ffmpeg -d /opt/ffmpeg
          chmod +x /opt/ffmpeg/ffmpeg
          rm /tmp/ffmpeg.zip
          echo "/opt/ffmpeg" >> $GITHUB_PATH

      - name: ๐Ÿš€ Run E2E tests
        run: cargo test --test e2e --all-features -- --test-threads=1

  analysis:
    name: ๐Ÿ” Static analysis
    needs: [build-and-test]
    runs-on: ubuntu-latest
    env:
      CLICOLOR: 1
    permissions:
      contents: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: ๐Ÿ› ๏ธ Install cargo-deny
        uses: taiki-e/install-action@7fa572463ed6f88f64fd37a4f8ca146df751432d # cargo-deny

      - name: ๐Ÿ” Security, License and Dependency Audit
        run: cargo deny check

      - name: ๐Ÿ› ๏ธ Install cargo-machete
        uses: taiki-e/install-action@6929d36b9cc9bd3c8a031f179ec7f72cffbfc6fa # cargo-machete

      - name: ๐Ÿงน Unused dependencies
        run: cargo machete

  coverage:
    name: ๐Ÿ“Š Code coverage
    needs: [e2e-tests]
    runs-on: ubuntu-latest
    env:
      CLICOLOR: 1
      SCCACHE_GHA_ENABLED: "true"
      RUSTC_WRAPPER: "sccache"
    permissions:
      contents: read

    steps:
      - name: ๐Ÿ›ก๏ธ Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
        with:
          egress-policy: audit
          disable-telemetry: true

      - name: ๐Ÿ“ Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: ๐Ÿ“ฆ Set up sccache
        uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
        with:
          disable_annotations: true

      - name: ๐Ÿ“ฆ Cache Rust artifacts
        uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
        with:
          shared-key: "coverage"
          cache-targets: false

      - name: ๐Ÿ› ๏ธ Set up Rust toolchain
        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
        with:
          components: llvm-tools-preview

      - name: ๐Ÿ“ฆ Install cargo-llvm-cov
        uses: taiki-e/install-action@c1305996457413b456b636a549d9f98354fd89cf # cargo-llvm-cov

      - name: ๐Ÿ› ๏ธ Install ffmpeg from boul2gom/ffmpeg-builds
        run: |
          curl -fsSL "https://github.com/boul2gom/ffmpeg-builds/releases/latest/download/ffmpeg-linux-x64.zip" -o /tmp/ffmpeg.zip
          mkdir -p /opt/ffmpeg
          unzip -j /tmp/ffmpeg.zip ffmpeg -d /opt/ffmpeg
          chmod +x /opt/ffmpeg/ffmpeg
          rm /tmp/ffmpeg.zip
          echo "/opt/ffmpeg" >> $GITHUB_PATH

      - name: ๐Ÿ“Š Generate coverage (unit + integration + e2e)
        run: |
          cargo llvm-cov clean --workspace
          cargo llvm-cov --no-report --test unit --all-features
          cargo llvm-cov --no-report --test integration --all-features
          cargo llvm-cov --no-report --test e2e --all-features -- --test-threads=1
          cargo llvm-cov report --lcov --output-path lcov.info

      - name: ๐Ÿ“ฆ Upload coverage to Codecov
        uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: lcov.info
          fail_ci_if_error: false