Compare commits
8 Commits
v1.0.0-alp
...
v1.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| e699c7ea5d | |||
| c4e55c0870 | |||
| 58d1b0c3de | |||
| cab1d2d498 | |||
| b5987d6eac | |||
| 9538e2a2bf | |||
| 42a4793953 | |||
| 3708df9525 |
@@ -36,12 +36,8 @@ archives:
|
||||
- goos: windows
|
||||
format: zip
|
||||
|
||||
# changelog:
|
||||
# sort: asc
|
||||
# filters:
|
||||
# exclude:
|
||||
# - "^docs:"
|
||||
# - "^test:"
|
||||
changelog:
|
||||
skip: true
|
||||
|
||||
dockers:
|
||||
- image_templates:
|
||||
|
||||
13
CHANGELOG.md
13
CHANGELOG.md
@@ -2,7 +2,18 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [Unreleased]
|
||||
## [v1.0.1] - 2023-11-24
|
||||
|
||||
- Fix crash on migrating a config that had > 1 destinations
|
||||
|
||||
## [v1.0.0] - 2023-11-23
|
||||
|
||||
- Don't start downloads until "start download" is pressed
|
||||
- Add "download option" for more per-download customisability, especially for destinations
|
||||
- Removed "destinations" as that is now possible more flexibly with download options.
|
||||
- Existing configurations using destinations are automatically migrated to an appropriate `yt-dlp -o ...` download options
|
||||
- Gropple now available via docker
|
||||
- Clean up web interface display on index page, especially when a playlist with many files is downloading
|
||||
|
||||
## [v0.6.0] - 2023-03-15
|
||||
|
||||
|
||||
147
README.md
147
README.md
@@ -1,41 +1,56 @@
|
||||
# gropple
|
||||
|
||||
A frontend to youtube-dl (or compatible forks, like yt-dlp) to download videos with a single click, straight from your web browser.
|
||||
A frontend to youtube-dl (or compatible forks, like yt-dlp) to download videos
|
||||
with a single click, straight from your web browser.
|
||||
|
||||

|
||||
|
||||
## Pre-requisites
|
||||
## Installing
|
||||
|
||||
* some familiarity with the command line
|
||||
* youtube-dl (plus any of its required dependencies, like ffmpeg)
|
||||
* golang compiler (only if you'd like to build from source)
|
||||
|
||||
## Build
|
||||
### From Source
|
||||
|
||||
go build
|
||||
|
||||
## Binaries
|
||||
### Standalone Binaries
|
||||
|
||||
Binaries are available at <https://github.com/tardisx/gropple/releases>
|
||||
|
||||
Gropple will automatically check for available updates and prompt you to
|
||||
upgrade.
|
||||
Binaries are available at <https://github.com/tardisx/gropple/releases> for most
|
||||
platforms.
|
||||
|
||||
## Running
|
||||
|
||||
./gropple
|
||||
### From Binaries
|
||||
|
||||
./gropple
|
||||
|
||||
There are no command line arguments. All configuration is done via the web
|
||||
interface. The address will be printed after startup:
|
||||
|
||||
2021/09/30 23:53:00 starting gropple v0.5.0 - https://github.com/tardisx/gropple
|
||||
2021/09/30 23:53:00 go to http://localhost:6123 for details on installing the bookmarklet and to check status
|
||||
2023/11/22 22:42:06 Starting gropple v1.0.0 - https://github.com/tardisx/gropple
|
||||
2023/11/22 22:42:07 Configuration loaded from /Users/username/path/config.yml
|
||||
2023/11/22 22:42:07 Visit http://localhost:6123 for details on installing the bookmarklet and to check status
|
||||
|
||||
### Docker
|
||||
|
||||
Copy the `docker-compose.yml` to a directory somewhere.
|
||||
|
||||
Edit the two `volume` entries to point to local paths where you would like to
|
||||
store the config file, and the downloads (the path on the left hand side of the
|
||||
colon).
|
||||
|
||||
Run `docker-compose up -d` to start the program.
|
||||
|
||||
Note that the docker images include `yt-dlp` and `ffmpeg` and are thus
|
||||
completely self-contained.
|
||||
|
||||
Run `docker-compose logs` to see the output of the program, if you are having
|
||||
problems.
|
||||
|
||||
## Using
|
||||
|
||||
Bring up `http://localhost:6283` (or your configured address) in your browser.
|
||||
You should see a link to the bookmarklet at the top of the screen, and the list
|
||||
of downloads (currently empty).
|
||||
Bring up `http://localhost:6283` (or the appropriate host if you are running it
|
||||
on a different machine) in your browser. You should see a link to the
|
||||
bookmarklet at the top of the screen, and the list of downloads (currently
|
||||
empty).
|
||||
|
||||
Drag the bookmarklet to your favourites bar, or otherwise bookmark it as you see
|
||||
fit. Any kind of browser bookmark should work. The bookmarklet contains embedded
|
||||
@@ -48,44 +63,106 @@ the bookmarklet.
|
||||
A popup window will appear. Choose a download profile and the download will
|
||||
start. The status will be shown in the window, updating in real time.
|
||||
|
||||
There is also an optional "download option" you can choose. These are discussed
|
||||
below.
|
||||
|
||||
You may close this window at any time without stopping the download, the status
|
||||
of all downloads is available on the index page.
|
||||
of all downloads is available on the index page. Clicking on the id number will
|
||||
show the popup again.
|
||||
|
||||
## Configuration
|
||||
|
||||
Click the "config" link on the index page to configure gropple. The default
|
||||
options are fine if you are running on your local machine. If you are running it
|
||||
remotely you will need to set the "server address" to ensure the bookmarklet has
|
||||
the correct URL in it.
|
||||
Click the "config" link on the index page to configure gropple.
|
||||
|
||||
### Configuring Downloaders
|
||||
The options in each part are dicussed below.
|
||||
|
||||
### Server
|
||||
|
||||
#### Port and Server Address
|
||||
|
||||
You can configure the port number here if you do not want the default of `6123`.
|
||||
|
||||
If you are running it on a machine other than `localhost` you will need to set
|
||||
the "server address" to ensure the bookmarklet has the correct URL in it.
|
||||
Similarly, if you are running it behind a reverse proxy, the address here must
|
||||
match what you would type in the browser so that the bookmarklet will work
|
||||
correctly.
|
||||
|
||||
#### Download path
|
||||
|
||||
The download path specifies where downloads will end up, *if* no specific `-o`
|
||||
options are passed to `yt-dlp`.
|
||||
|
||||
#### Maximum active downloads per domain
|
||||
|
||||
Gropple will limit the number of downloads per domain to this number. Increasing
|
||||
this will likely result in failed downloads when server rate limiters notice
|
||||
you.
|
||||
|
||||
#### UI popup size
|
||||
|
||||
Changes the size of the popup window.
|
||||
|
||||
### Download Profiles
|
||||
|
||||
Gropple's default configuration uses `yt-dlp` and has two profiles set up, one
|
||||
for downloading video, the other for downloading audio (mp3).
|
||||
|
||||
Each download profile consists of a name (for your reference), a command to run,
|
||||
and a number of arguments.
|
||||
|
||||
Note that gropple does not include any downloaders, you have to install them
|
||||
separately.
|
||||
separately (unless using the docker image).
|
||||
|
||||
If you would like to use a youtube-dl compatible fork or change the options you
|
||||
can do so on the right hand side. Create as many profiles as you wish, whenever
|
||||
you start a download you can choose the appropriate profile.
|
||||
can do so here. Create as many profiles as you wish, whenever you start a
|
||||
download you can choose the appropriate profile.
|
||||
|
||||
Note that the command arguments must each be specified separately - see the
|
||||
default configuration for an example.
|
||||
default configuration. For example, if you have a single argument like
|
||||
`--audio-format mp3`, it will be parsed by the `yt-dlp` as a single, long
|
||||
unknown argument, and will fail. This needs to be configured as two arguments,
|
||||
`--audio-format` and `mp3`.
|
||||
|
||||
While gropple will use your `PATH` to find the executable, you can also specify
|
||||
a full path instead. Note that any tools that the downloader calls itself (for
|
||||
instance, `ffmpeg`) will need to be available on your path.
|
||||
|
||||
### Alternate destinations
|
||||
### Download Options
|
||||
|
||||
Gropple supports adding additional optional destinations. By default, all
|
||||
downloads will be stored in the main download path specified in the config. You
|
||||
can also add one or more destinations, and you can choose one of these
|
||||
destinations when queueing a new download, or while it is still downloading from
|
||||
the popup.
|
||||
There are also an arbitrary amount of Download Options you can configure. Each
|
||||
one specifies one or more extra arguments to add to the downloader command line.
|
||||
The most common use for this is to have customised download paths. For instance,
|
||||
sometimes you might want to bundle all files into a single directory, other
|
||||
times you might want to separate files by download playlist URL or similar.
|
||||
|
||||
The file will be moved after downloading is complete.
|
||||
Most of this is done directly through appropriate options for `yt-dlp`, see the
|
||||
[output template
|
||||
documentation](https://github.com/yt-dlp/yt-dlp#output-template).
|
||||
|
||||
However, gropple offers two extra substitutions:
|
||||
|
||||
* `%GROPPLE_HOST%`
|
||||
* `%GROPPLE_PATH%`
|
||||
|
||||
These will be replaced with the hostname, and path of the download,
|
||||
respectively.
|
||||
|
||||
So, a playlist URL `https://www.youtube.com/@UsernameHere`
|
||||
|
||||
With a download option setup like this:
|
||||
|
||||
* Name of Option: Split by Host and Path
|
||||
* Arguments:
|
||||
* -o
|
||||
* /Downloads/%GROPPLE_HOST%/%GROPPLE_PATH%/%(title)s [%(id)s].%(ext)s
|
||||
|
||||
Will result in downloads going into the path
|
||||
`/Downloads/www.youtube.com/@UsernameHere/...`.
|
||||
|
||||
Note that this also means that `yt-dlp` can resume partially downloaded files, and
|
||||
also automatically 'backfill', downloading only files that have not been
|
||||
downloaded yet from that playlist.
|
||||
|
||||
## Portable mode
|
||||
|
||||
|
||||
@@ -300,8 +300,8 @@ func (cs *ConfigService) LoadConfig() error {
|
||||
Args: []string{"-o", fmt.Sprintf("%s/%%(title)s [%%(id)s].%%(ext)s", c.Destinations[i].Path)},
|
||||
}
|
||||
c.DownloadOptions = append(c.DownloadOptions, newDownloadOption)
|
||||
c.Destinations = nil
|
||||
}
|
||||
c.Destinations = nil
|
||||
configMigrated = true
|
||||
log.Print("migrated config from version 3 => 4")
|
||||
}
|
||||
|
||||
@@ -102,6 +102,66 @@ profiles:
|
||||
os.Remove(cs.ConfigPath)
|
||||
}
|
||||
|
||||
func TestMigrateV3toV4CrashBug(t *testing.T) {
|
||||
v3Config := `config_version: 3
|
||||
server:
|
||||
port: 6123
|
||||
address: https://superaddress.here.com
|
||||
download_path: /home/path/gropple
|
||||
maximum_active_downloads_per_domain: 2
|
||||
ui:
|
||||
popup_width: 500
|
||||
popup_height: 500
|
||||
destinations:
|
||||
- name: somegifs
|
||||
path: /home/path/somegifs
|
||||
- name: otherstuff
|
||||
path: /home/path/otherstuff
|
||||
profiles:
|
||||
- name: standard video
|
||||
command: yt-dlp
|
||||
args:
|
||||
- --newline
|
||||
- --write-info-json
|
||||
- -f
|
||||
- bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best
|
||||
- --verbose
|
||||
- --embed-metadata
|
||||
- --embed-subs
|
||||
- --embed-thumbnail
|
||||
- name: standard mp3
|
||||
command: yt-dlp
|
||||
args:
|
||||
- --extract-audio
|
||||
- --audio-format
|
||||
- mp3
|
||||
- --prefer-ffmpeg
|
||||
`
|
||||
cs := configServiceFromString(v3Config)
|
||||
err := cs.LoadConfig()
|
||||
if err != nil {
|
||||
t.Errorf("got error when loading config: %s", err)
|
||||
}
|
||||
if cs.Config.ConfigVersion != 4 {
|
||||
t.Errorf("did not migrate version (it is '%d')", cs.Config.ConfigVersion)
|
||||
}
|
||||
if cs.Config.Server.MaximumActiveDownloads != 2 {
|
||||
t.Error("did not add MaximumActiveDownloads")
|
||||
}
|
||||
if len(cs.Config.Destinations) != 0 {
|
||||
t.Error("incorrect number of destinations from migrated file")
|
||||
}
|
||||
if assert.Len(t, cs.Config.DownloadOptions, 2) {
|
||||
if assert.Len(t, cs.Config.DownloadOptions[0].Args, 2) {
|
||||
assert.Equal(t, "-o", cs.Config.DownloadOptions[0].Args[0])
|
||||
assert.Equal(t, "/home/path/somegifs/%(title)s [%(id)s].%(ext)s", cs.Config.DownloadOptions[0].Args[1])
|
||||
assert.Equal(t, "-o", cs.Config.DownloadOptions[1].Args[0])
|
||||
assert.Equal(t, "/home/path/otherstuff/%(title)s [%(id)s].%(ext)s", cs.Config.DownloadOptions[1].Args[1])
|
||||
}
|
||||
}
|
||||
os.Remove(cs.ConfigPath)
|
||||
}
|
||||
|
||||
func configServiceFromString(configString string) *ConfigService {
|
||||
tmpFile, _ := os.CreateTemp("", "gropple_test_*.yml")
|
||||
tmpFile.Write([]byte(configString))
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
gropple:
|
||||
build: .
|
||||
image: tardisx/gropple:$VERSION
|
||||
@@ -1,12 +1,11 @@
|
||||
version: "3.9"
|
||||
|
||||
|
||||
services:
|
||||
gropple:
|
||||
build: .
|
||||
image: tardisx/gropple:latest
|
||||
volumes:
|
||||
- ./gropple-config-dir:/config
|
||||
- ./downloads:/downloads/
|
||||
- /tmp/gropple-config-dir/:/config
|
||||
- /tmp/downloads/:/downloads/
|
||||
restart: always
|
||||
ports:
|
||||
- "6123:6123"
|
||||
|
||||
2
main.go
2
main.go
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
func main() {
|
||||
versionInfo := &version.Manager{
|
||||
VersionInfo: version.Info{CurrentVersion: "v0.7.0"},
|
||||
VersionInfo: version.Info{CurrentVersion: "v1.0.1"},
|
||||
}
|
||||
log.Printf("Starting gropple %s - https://github.com/tardisx/gropple", versionInfo.GetInfo().CurrentVersion)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user