## Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (as of version 2.1.15).

## [2.2.0] - 2023-11-17

### Changed

- Using zimscraperlib 2.0.0 (#171)
- Using python 3.10 + debian bookworm (dropped support for older Python versions) (#180)
- Adopt Python bootstrap conventions (including hatch) (#180)

### Fixed

- Fixed local path media (profile, banner) not working (#178)
- Unset `metadata_from` in `youtube2zim-playlists` (#185)

## [2.1.18] - 2022-11-09

### Changed

- Switched to yt-dlp instead of youtube_dl
- Added fallback for subtitle languages with IDs-like suffixes (#161)
- Removed a reference to ZIM namespace that would break if first video has subtitles
- Fixed expected returncodes on errors (#166)
- Using ogv.js 1.8.9, videojs 7.20.3 and latest videojs-ogvjs (master)
- Using zimscraperlib 1.8.0

## [2.1.17] - 2022-08-01

### Changed

- Fixed typo breaking JS

## [2.1.16] - 2022-08-01

### Changed

- Fixed Jinja2's dependency: Markup_safe version (#156)

## [2.1.15] - 2022-07-29

### Added

- Additional YT language code mapping: zh-Hant-HK, zh-Hans-SG

### Changed

- using zimscraperlib 1.6.2
- fixed crash adding ogvjs's js.mem file
- fixed playlists switching removing videos
- Removed inline JS to comply with some CSP (#154)

## [2.1.13]

- More YT language code mapping

## [2.1.12]

- fixed inter-dependencies issue

## [2.1.11]

- removed banner retrieval due to API change

## [2.1.10]

- fixes to Webp for apple polyfill

## [2.1.9]

- fixed WebP poster for apple on video pages

## [2.1.8]

- fixed subtitles not showing on homepage preview video
- fixed crash on iw (Hebrew) subtitles
- fixed usage on older browsers (without ES6 support)
- use WebP for thumbnails
- fix seeking on Apple browsers

## [2.1.7]

- using zimscraperlib 1.2.0
- replaced zimwriterfs with pylibzim
- tmp-dir now sanitized as build-dir
- fixed --debug not forwarded in playlists mode
- changed workdir to /output in docker image

## [2.1.6]

- using video-js-7.8.1
- Added youtube2zim-playlists script to create one zim per playlist
- --zim-file now supports the `{period}` replacement string to insert date (#99)
- picture-in-picture toggle now hidden
- using zimscraperlib to encode videos
- logging transfer before starting them
- added video_encoding_tester script in contrib/
- --tmp-dir option to set where temp files are downloaded/handled (system temp otherwise)
- thumbnail now converted to JPEG if received as WebP
- thumbnail resize now supports upscaling if original is too small
- thumnail resize and conversion from zimscraperlib
- using zimscraperlib 1.1.2
- removed skip-download option
- removed only_test_branding option
- docker to use zimwriterfs 1.3.10

## [2.1.5]

- Fixed regression causing S3 to only use videos from cache (never youtube)

## [2.1.4]

- Fixed compression issue on system without swap (#75)
- Using 44kHz audio sample rate on low-quality to save some space (#74)
- Added S3 Optimization Cache support (#69 #80)
- Bumped some dependencies (zimscraperlib, kiwixstorage)
- Filtering out videos with missing channel (#76)

## [2.1.3]

- Fixed regresssion on --low-quality not working anymore

## [2.1.2]

- Fixed video without sound due to change on Youtube side (#70)

## [2.1.1]

- Using zimscraperlib

## [2.1.0]

- Fixed not working with too much videos (URI too long)
- Secondary color now using 2nd most used color in profile picture
- Display playlists select only if there is multiple playlists
- Added --autoplay option
- Added kiwix-desktop workaround (no status check on XHR)
- Added support for playlists with missing videos
- Added period (YYYY-MM) to filename
- Fixed crash if using subtitles with non-iso language code
- Fixed missing subtitles (non-auto-generated)
- Added --pagination option to set max number of videos per page
- Added subtitles to welcome video as well
- Use (and convert from) `best` format if chosen (mp4|webm) not available
- Fixed colors assignation
- Added --only-test-branding option to generate a fake home page to test branding/colors
- Fixed playlists list for channels not saved to cache
- Removed `chosen` style on playlist select element (back to native)
- Playlists now sorted by title. First playlist remains `Uploads` one though.
- Docker container auto-updates youtube-dl on start
- Added concurrency via --concurrency (defaults to none)
- Fixed date formatting: localized medium-sized version as in Youtube
- Displaying error messages from youtube on API errors
- Fixed API requests for large number of videos in playlist
- Made --name mandatory
- Tags now specified as comma-separated list
- Fixed channel info retrieval in some cases
- Don't fail on non-matching language-to-locale (defaults to EN)
- Added --locale to specify locale to use for translations/dates
- Splitted logs into stdout and stderr
- Failed to download videos don't stop the process. Nb of failed displayed on stderr

## [2.0] 2019-08

- Rewrote scraper script
  - using Youtube API instead of parsing DOM
  - simpler code (less)
  - using youtube-dl to download video, thumbnail, subtitles
  - faster (bundled download for video, thumbnail and subtitles – single ytdl call)
  - option to use auto-generated subtitles
  - added favicon in HTML (for kiwix-serve use)
  - kept FFMPEF options code for lower-quality
  - kept UI: html, css, js.
  - updated videojs
  - added support for webm in all browsers via ogv.js and videosjs-ogvjs
  - defaults to webm
  - made sure video are included only once (even if on multiple playlists)
  - Dockerfile runs current code, not a pypi version
  - improved UI on mobile/responsive
  - translatable UI-texts, using --language (supports EN,FR atm.)
  - fixed audio in low-quality mp4 files on quicktime-based platforms
- Known bugs:
  - --all-subtitles is slow #38
  - Safari (iOS/macOS) via kiwix-serve:
     -  Fullscreen is broken in Safari #33
  - firefox/chromium via kiwix-serve:
     - Controls buggy in firefox/chrome #34
     - Fullscreen-exit is broken in firefox/chrome #35
  - android:
     - No fullscreen support in android #36
     - exit rotation is buggy on android #37
  - iOS:
     - fullscreen is broken on iOS #39
  - macOS:
     - not working on macOS #40
  - desktop (linux/windows):
     - no fullscreen support on kiwix-desktop #42
     - subtitles don't work on kiwix-desktop #41

## [1.1] - 2017-04-04:

- Make it as python package

## [1.0] - 2016-06-23:

- Get playlist or user channel (and playlist of user) from youtube
- the most view video is show on top and bigger
- --lowquality option for downloading in mp4 and re-encode aggressively in webm
