Skip to main content

Download videos from Yle servers

Build status PyPI version

Copyright (C) 2010-2024 Antti Ajanki, antti.ajanki@iki.fi

License: GPL v3 or later

Homepage: https://aajanki.github.io/yle-dl/index-en.html

Source code: https://github.com/aajanki/yle-dl

yle-dl is a tool for downloading media files from the video streaming services of the Finnish national broadcasting company Yle: Yle Areena, Elävä Arkisto and Yle news.

Installation

Below are general installation instructions. See a separate page for specialized installation instructions for Debian, Ubuntu, Mac OS X, Windows and Android.

1. Install the dependencies

  • Python 3.7+
  • ffmpeg (subtitles fully supported only on ffmpeg 4.1 or later)

Optionally for few rare streams:

  • wget

2. Install yle-dl

  1. Install pipx
  2. Install yle-dl: pipx install yle-dl

Installing yle-dl with all optional dependencies (pipx install yle-dl[extra]) enables storing video metadata as extended file attributes and automatically detecting filesystems that require restricted character sets.

Alternatively, installing the source distribution in the editable mode: Download the sources and run the following in the source directory: pip3 install --user .

Usage

yle-dl [options] URL

or

yle-dl [options] -i filename

where URL is the address of the Areena or Elävä arkisto web page where you would normally watch the video in a browser.

yle-dl options:

  • -o filename Save stream to the named file

  • -i filename Read input URLs to process from the named file, one URL per line

  • --latestepisode Download the latest episodes

  • --showurl Print the URL of the stream, don't download

  • --showtitle Print stream title, don't download

  • --showmetadata Print stream metadata as JSON

  • --vfat Create Windows-compatible filenames

  • --sublang lang Disable subtitles if lang is "none"

  • --resolution res Maximum vertical resolution in pixels

  • --maxbitrate br Maximum bitrate stream to download, integer in kB/s or "best" or "worst". Not all streams support limited bitrates.

  • --postprocess cmd Execute a command cmd after a successful download. The command is called with the downloaded video file as the first parameter and subtitle files (if any) as the following parameters.

  • --proxy uri HTTP(S) proxy to use. Example: --proxy localhost:8118

  • --destdir dir Save files to dir

  • --pipe Dump stream to stdout for piping to media player. E.g. yle-dl --pipe URL | vlc -.

  • -V, --verbose Show verbose debug output

Type yle-dl --help to see the full list of options.

To download through a SOCKS5 proxy, use tsocks or a similar wrapper.

Using with libav instead of ffmpeg

yle-dl --ffmpeg avconv --ffprobe avprobe ...

Config file

Arguments that start with '--' can also be set in a config file. The default config file is ~/.yledl.conf (or alternatively ~/.config/yledl.conf) or one can be specified via --config. See yledl.conf.sample for an example configuration.

Config file syntax allows: key=value, flag=true. If an arg is specified in more than one place, then command line values override config file values which override defaults.

Contributed packages for various distros

A list of contributed packages

Integration tests

pytest-3

Some tests succeed only when run on a Finnish IP address because some Areena streams are available only in Finland. By default these tests are skipped. To run all tests, include the "--geoblocked" flag:

pytest-3 --geoblocked

Running only a single test file:

pytest-3 tests/integration/test_areena_radio_it.py

Examples

Yle Areena

Save an Areena stream to a file with an automatically generated name:

yle-dl https://areena.yle.fi/1-787136

Save a stream to a file called video.mkv:

yle-dl https://areena.yle.fi/1-787136 -o video.mkv

Playing in mpv (or in vlc or in any other video player) without downloading first:

yle-dl --pipe https://areena.yle.fi/1-787136 | mpv --slang=fi -

Executing a script to postprocess a downloaded video (see the example postprocessing script at scripts/muxmp4):

yle-dl --postprocess scripts/muxmp4 https://areena.yle.fi/1-787136

Areena live TV broadcasts

yle-dl tv1

yle-dl tv2

yle-dl teema

Record the broadcast shown an hour (3600 seconds) ago:

yle-dl --startposition -3600 tv1

Elävä Arkisto

yle-dl https://yle.fi/aihe/artikkeli/2010/10/28/studio-julmahuvi-roudasta-rospuuttoon

Embedded videos on the yle.fi news articles

yle-dl https://yle.fi/a/74-20036911

Creating a new release

Release instructions

Known problems

Problem: Subtitles are visible only for the first five minutes.

Solution: Update your ffmpeg to version 4.1 or later.

Problem: Subtitles are missing on live stream

This is a known problem. Currently there are no fixes.

Problem: I get warnings about unsupported subtitles and dropping subtitles

Downloading produces a bunch of warnings such as "Can't support the subtitle" and "Dropping 114 duplicated subtitle events".

These warning messages are harmless and can be ignored. Subtitles should get downloaded correctly in most cases despite the warnings. The only exceptions are live streams.

Problem: I installed yle-dl but get an error message "command not found" when I try to run it

The installation location is not on shell's search path. Use the full path to run yle-dl: ~/.local/bin/yle-dl

Better yet, append the search path permanently by editing shell's config file. For example, on bash do the following:

echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >> ~/.bashrc && source ~/.bashrc

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yle_dl-20240429.tar.gz (79.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yle_dl-20240429-py3-none-any.whl (67.3 kB view details)

Uploaded Python 3

File details

Details for the file yle_dl-20240429.tar.gz.

File metadata

  • Download URL: yle_dl-20240429.tar.gz
  • Upload date:
  • Size: 79.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for yle_dl-20240429.tar.gz
Algorithm Hash digest
SHA256 d1618505c41916f8620ae5704939b0a127dd653bc91afb20d0e6183e342cdb7c
MD5 3595adc9e8e9a0cbbe972d45c54c4756
BLAKE2b-256 4d6a60344980cdb6e40e93608ed81f31a844773cda5d3e90aa1e84f05308b54a

See more details on using hashes here.

File details

Details for the file yle_dl-20240429-py3-none-any.whl.

File metadata

  • Download URL: yle_dl-20240429-py3-none-any.whl
  • Upload date:
  • Size: 67.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for yle_dl-20240429-py3-none-any.whl
Algorithm Hash digest
SHA256 aa0c0adba649da293b32c8081f03a96fd0c1a6443e3fedbfbb5753e2e8b08f59
MD5 b0de20f7d8c2b795a1d99fd1b5a9e4f4
BLAKE2b-256 dcaee74a3bdb3d413c822c3a57bfc719561ca378a8e9a16cce5a255f532eea91

See more details on using hashes here.

Release history Release notifications | RSS feed

20260716

2 files

20260624

2 files

20260520

2 files

20250730

2 files

20250614

2 files

20250316

2 files

20250227

2 files

20250126

2 files

20240927

2 files

20240806

2 files

20240706

2 files

This release

20240429 This release

2 files

20240130

2 files

20231214

2 files

20231120

2 files

20230611

2 files

20221231

2 files

20221111

2 files

20221015

2 files

20220830

2 files

20220704

2 files

20220610

2 files

20220531

2 files

20220518

2 files

20220425

2 files

20220213

2 files

20211213

2 files

20211207

2 files

20211203

2 files

20210917

2 files

20210808

2 files

20210704

2 files

20210502

2 files

20210212

2 files

20201022

2 files

20201019

2 files

20200807

2 files

20200628

2 files

20200618

2 files

20200419

2 files

20200222

2 files

20191231

2 files

20191022

2 files

20190614

2 files

20190502

2 files

20190331

2 files

20190203

2 files

20181221

2 files

20181103

2 files

2.37

2 files

2.36

2 files

2.35

2 files

2.34

2 files

2.33

2 files

2.32

2 files

2.31

2 files

2.30

2 files

2.29

2 files

2.28

2 files

2.27

2 files

2.26

2 files

2.25

2 files

2.24

2 files

2.23

2 files

2.22

2 files

2.21

2 files

2.20

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page