Skip to content

Small utility program for downloading bookmarked youtube links using yt-dlp.

License

Notifications You must be signed in to change notification settings

Neurofibromin/bookmark-dlp

Repository files navigation

bookmark-dlp

Utility program for downloading bookmarked YouTube links using yt-dlp. It replicates the folder structure of your Chrome/Brave/Firefox/etc. bookmarks and calls yt-dlp to download all YouTube videos among the bookmarks.

bookmark-dlp icon

Contents

Status

Prerelease .NET NuGet CodeQL Copr build status Packaging status

Usage

  • Run the executable and select your browser profile to auto-import bookmarks, or load a Google Takeout Chrome bookmarks HTML file.
  • Choose an output folder for the downloaded files.
  • If necessary, specify the location of the yt-dlp executable in the settings.
  • CLI usage options are available.

Installation & How to get

Make sure yt-dlp is installed: If you do not have the newest version you can get it here. Download the executable for your system from releases. bookmark-dlp is packaged in some platforms native package distribution.

Fedora

sudo dnf copr enable neurofibromin/bookmark-dlp
sudo dnf install bookmark-dlp

Arch (AUR)

yay bookmark-dlp

Standalone releases

Windows Linux OSX (semi-supported)
x64 x64 x64
x32 N/A N/A
arm64 arm64 arm64

Additional releases

Linux Installers:

package x64 arm64
Flatpak bookmark-dlp-0.4.1.x86_64.flatpak bookmark-dlp-0.4.1.aarch64.flatpak
RPM bookmark-dlp-0.4.1.x86_64.rpm N/A
DEB bookmark-dlp-0.4.1.amd64.deb bookmark-dlp-0.4.1.arm64.deb
AppImage bookmark-dlp-0.4.1.x86_64.AppImage bookmark-dlp-0.4.1.aarch64.AppImage

Limitations

  • Currently "exports" from browsers do not work.
  • Output folder cannot be a network folder on some platforms.

CLI Usage

Put the Bookmarks.html and the yt-dlp(.exe) into the same directory as the executable. Get the Bookmarks.html from a Google takeout.

Run the executable:
Windows: in CMD or PowerShell: bookmark-dlp-0.4.1.exe --interactive
Linux: in terminal in the directory: ./bookmark-dlp-linux-x64-0.4.1 --interactive More flags/usage info: ./bookmark-dlp --help

How it works

  1. The program checks for a Bookmarks.html file in its root directory. If not found, it searches default locations for supported browsers.
  2. It replicates the folder structure of the bookmarks bar on disk.
  3. YouTube links are extracted from the bookmarks and organized into text files.
  4. Helper scripts are generated for each folder to call yt-dlp for downloading.
  5. Optional: Provide a yt-dlp.conf file in the program root directory for advanced configurations.

More details

If a Bookmarks.html exists within its root directory/where it was called from, that is the default input file. Default locations for some browsers (see list of supported browsers) are checked, to find any browser profiles with bookmarks.
When a bookmark containing file is found or provided, the content is taken in, and the folder structure of the bookmarks bar is replicated on disk, in the chosen output directory (root(running) directory by default). The youtube links in the given folder are written into a ${foldername}.txt file. Complex youtube links (not links for video, but for channels and playlists etc) can be included, but are excluded by default.
A helper script (.bat or .sh) is also generated for each folder. If a folder contains no links (and no files at all) it is deleted. The helper scripts are called, these in turn call yt-dlp. The presence of yt-dlp binaries is checked details at Locations for files. The scripts run one at a time, in sequence. I recommend also providing a yt-dlp.conf file into program root (running) directory, and enabling the archive function - that way bookmark-dlp can be run from the same directory again, and only new files get downloaded. If the same directory is used for different profiles things can get written into same directories, but probably nothing should be lost.

Locations for files

Config for bookmark-dlp:

  1. local
    1. Path.Combine(Directory.GetCurrentDirectory(), "bookmark-dlp.conf")
    2. Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bookmark-dlp.conf")
  2. OS config directory
    • windows = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "bookmark-dlp\\bookmark-dlp.conf")
    • linux = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "bookmark-dlp/bookmark-dlp.conf")
    • osx = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.Personal), "bookmark-dlp/bookmark-dlp.conf")

If no config is found at startup popup asks for location for new config file.

yt-dlp binary locations:

  1. program is called from
  2. program executable is found in
  3. chosen output folder
  4. path

accepted filenames for the yt-dlp binary:

  • osx: { "yt-dlp", "yt-dlp_macos", "yt-dlp_macos_legacy" }
  • linux: {"yt-dlp", "yt-dlp_linux", "yt-dlp_linux_aarch64", "yt-dlp_linux_armv7l" }
  • windows: "yt-dlp.exe"

yt-dlp.config is sought in the following locations:

https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#configuration

  1. bookmark-dlp program is called from
  2. yt-dlp executable is found in
  3. bookmark-dlp chosen output folder
  4. bookmark-dlp executable is found in
  5. yt-dlp default folder
    1. ${XDG_CONFIG_HOME}/yt-dlp.conf
    2. ${XDG_CONFIG_HOME}/yt-dlp/config
    3. ${XDG_CONFIG_HOME}/yt-dlp/config.txt
    4. ${APPDATA}/yt-dlp.conf
    5. ${APPDATA}/yt-dlp/config
    6. ${APPDATA}/yt-dlp/config.txt
    7. ~/yt-dlp.conf
    8. ~/yt-dlp.conf.txt
    9. ~/.yt-dlp/config
    10. ~/.yt-dlp/config.txt
    11. /etc/yt-dlp.conf
    12. /etc/yt-dlp/config
    13. /etc/yt-dlp/config.txt

Releases

Windows and linux compatible, written in C#, builds for x86 and ARM available. Flatpaks, DEB and RPM packages are also generated. Arch packagebuild is in the repo, but also available in the AUR.
Build your own: this project is open source

Standalone releases

Additional releases

Aims


CI/CD


new features

  • start console and gui from same binary
  • better versioning
  • refactor bookmarks import to library
  • tray icon
  • dot desktop file
  • add manpages
  • logging
  • create project icon


Increase support

  • safari support
  • opera osx support
  • bsd support
  • docker
  • netcore3.1
  • browsers installed as flatpaks
  • sign appimage with pupnet
  • Add screenshots to README.md
  • Add manpage to .spec
  • Add manpage to PKGBUILD
  • Add manpage to .nix

Signatures, hashes and integrity checks

The following pgp keys are valid:

Fingerprint Description
9F9BFE94618AD26667BD28214F671AFAD8D4428B used in git and manually signed packages
5C85EF4F34E089A04B2063A5833E01FC62E56779 used in CICD pipelines to autosign packages where supported

Keyservers:

Public keys are also distributed with the build files.

SHA256 hashes for the binaries are produced in the GitHub workflow and found in checksum.txt under release assets.

The bookmark-dlp icons are licensed under CC BY-NC-SA 4.0.

Build instructions

Install dependencies: dotnet

git clone -b master https://github.com/Neurofibromin/bookmark-dlp bookmark-dlp
cd bookmark-dlp
dotnet restore
dotnet publish bookmark-dlp/bookmark-dlp.csproj --configuration Release

About

Small utility program for downloading bookmarked youtube links using yt-dlp.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published