Rev 16 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 16 | Rev 21 | ||
---|---|---|---|
1 | 1 | ||
2 | # ViaThinkSoft YouTube Downloader 2.3.1 |
2 | # ViaThinkSoft YouTube Downloader 2.4.1 |
3 | 3 | ||
4 | YouTube Downloader is a tool for Linux. It is a wrapper for youtube-dl (or any compatible forks) and offers several additional functionalities. |
4 | YouTube Downloader is a tool for Linux. It is a wrapper for youtube-dl (or any compatible forks) and offers several additional functionalities. |
5 | 5 | ||
6 | Special features: |
6 | Special features: |
7 | - Downloading of all videos of a channel or a playlist. |
7 | - Downloading of all videos of a channel or a playlist. |
8 | - Automatic searching inside channels or globally (whole YouTube) |
8 | - Automatic searching inside channels or globally (whole YouTube) |
9 | - You can download videos and audio files. |
9 | - You can download videos and audio files. |
10 | - YouTube-IDs can be automatically written in the ID tag of downloaded mp3 files. |
10 | - YouTube-IDs can be automatically written in the ID tag of downloaded mp3 files. |
11 | - An automatically managed list of already downloaded videos allows you to move away from the downloaded files without the risk of downloading the already downloaded files again. |
11 | - An automatically managed list of already downloaded videos allows you to move away from the downloaded files without the risk of downloading the already downloaded files again. |
12 | - An automatically managed list of failed downloads will avoid that a video, which is not available anymore, is tried to be downloaded too many times. |
12 | - An automatically managed list of failed downloads will avoid that a video, which is not available anymore, is tried to be downloaded too many times. |
13 | - Creation of SFV and/or MD5 checksum files. |
13 | - Creation of SFV and/or MD5 checksum files. |
14 | - The tool is fully CLI and is optimized for cronjobs. |
14 | - The tool is fully CLI and is optimized for cronjobs. |
15 | 15 | ||
16 | ## Syntax |
16 | ## Syntax |
17 | 17 | ||
18 | ./ytdwn [-t|--type v:[ext]|a:[ext]] Type video or audio and preferred output type, e.g. 'a:mp3' (default v:) |
18 | ./ytdwn [-t|--type v:[ext]|a:[ext]] Type video or audio and preferred output type, e.g. 'a:mp3' (default v:) |
19 | [-o|--outputDir <dir>] Default current working directory |
19 | [-o|--outputDir <dir>] Default current working directory |
20 | [-a|--alreadyDownloaded <file>] |
20 | [-a|--alreadyDownloaded <file>] |
21 | [-f|--failList <file> <treshold>] This file logs failures. |
21 | [-f|--failList <file> <treshold>] This file logs failures. |
22 | [-F|--failTreshold <num>] Don't download if failure (-f) treshold is reached. (Default: 3) |
22 | [-F|--failTreshold <num>] Don't download if failure (-f) treshold is reached. (Default: 3) |
23 | [-V|--version] Shows the version |
23 | [-V|--version] Shows the version |
24 | [-v|--verbose] Displays verbose information to STDOUT |
24 | [-v|--verbose] Displays verbose information to STDOUT |
25 | [-h|--help] Shows the help page. |
25 | [-h|--help] Shows the help page. |
26 | [-N|--no-mp3-tagtransfer] Disables transfer of video ID to MP3 ID tag. |
26 | [-N|--no-mp3-tagtransfer] Disables transfer of video ID to MP3 ID tag. |
27 | This feature requires the package "id3v2". |
27 | This feature requires the package "id3v2". |
28 | [-H|--checksumMode] Which checksum files shall be written for new files. |
28 | [-H|--checksumMode] Which checksum files shall be written for new files. |
29 | Must be 'None', 'MD5', 'SFV', or 'MD5,SFV'. |
29 | Must be 'None', 'MD5', 'SFV', or 'MD5,SFV'. |
30 | [-T|--default-template <t>] Sets default filename template. |
30 | [-T|--default-template <t>] Sets default filename template. |
31 | (Default: '%(title)s-%(id)s.%(ext)s') |
31 | (Default: '%(title)s-%(id)s.%(ext)s') |
32 | [-X|--extra-args <args>] Additional arguments passed through youtube-dl. (Default "-ic") |
32 | [-X|--extra-args <args>] Additional arguments passed through youtube-dl. (Default "-ic") |
33 | [-A|--api-key <file|key>] Specifies the API key, or a file containing the API key |
33 | [-A|--api-key <file|key>] Specifies the API key, or a file containing the API key |
34 | (Default: ~/.yt_api_key) |
34 | (Default: ~/.yt_api_key) |
35 | [--cookies=<file>] A netscape compatible cookie file (for age restricted videos |
35 | [--cookies=<file>] A netscape compatible cookie file (for age restricted videos |
36 | (Default: ~/.yt_cookkies) |
36 | (Default: ~/.yt_cookkies) |
37 | [-C|--resultcache <file>] Allows video results to be cached in this file; |
37 | [-C|--resultcache <file>] Allows video results to be cached in this file; |
38 | only for playlists or channels. |
38 | only for playlists or channels. |
39 | [-O|--create-outputdir] Allows creation of the output directories, recursively. |
39 | [-O|--create-outputdir] Allows creation of the output directories, recursively. |
40 | [--downloader=exename] Binary file name of a youtube-dl compatible tool. |
40 | [--downloader=exename] Binary file name of a youtube-dl compatible tool. |
41 | Currently supported/tested: youtube-dl, youtube-dlc, yt-dlp. |
41 | Currently supported/tested: youtube-dl, youtube-dlc, yt-dlp. |
42 | [--] |
42 | [--] |
43 | <resource> [<resource> ...] |
43 | <resource> [<resource> ...] |
44 | 44 | ||
45 | For all paths (outputDir, alreadyDownloaded, apikey, failList and resultcache), you can use the |
45 | For all paths (outputDir, alreadyDownloaded, apikey, failList and resultcache), you can use the |
46 | term '[listname]' which will be replaced by the basename of the current list file (without file extension). |
46 | term '[listname]' which will be replaced by the basename of the current list file (without file extension). |
47 | For example you can do following: |
47 | For example you can do following: |
48 | 48 | ||
49 | ./ytdwn -o 'downloads/[listname]' -- list:*.list |
49 | ./ytdwn -o 'downloads/[listname]' -- list:*.list |
50 | 50 | ||
51 | If no list file is processed, it will be replaced with nothing. |
51 | If no list file is processed, it will be replaced with nothing. |
52 | 52 | ||
53 | The "alreadyDownloaded" argument contains a file which will be managed by ytdwn. |
53 | The "alreadyDownloaded" argument contains a file which will be managed by ytdwn. |
54 | It will contain all video IDs which have been downloaded. This allows you to |
54 | It will contain all video IDs which have been downloaded. This allows you to |
55 | move away the already downloaded files, and ytdwn will not download them again. |
55 | move away the already downloaded files, and ytdwn will not download them again. |
56 | 56 | ||
57 | Examples for type: |
57 | Examples for type: |
58 | - `v:` = best video quality |
58 | - `v:` = best video quality |
59 | - `a:` = best audio only |
59 | - `a:` = best audio only |
60 | - `a:mp3` = audio only, mp3 |
60 | - `a:mp3` = audio only, mp3 |
61 | - Valid audio formats according to "man youtube-dl" are |
61 | - Valid audio formats according to "man youtube-dl" are |
62 | "best", "aac", "flac", "mp3", "m4a", "opus", "vorbis", or "wav"; "best" by default |
62 | "best", "aac", "flac", "mp3", "m4a", "opus", "vorbis", or "wav"; "best" by default |
63 | 63 | ||
64 | A `<resource>` can be one of the following: |
64 | A `<resource>` can be one of the following: |
65 | 65 | ||
66 | vid:<video ID> |
66 | vid:<video ID> |
67 | vurl:<youtube video URL> |
67 | vurl:<youtube video URL> |
68 | pid:<playlist ID> |
68 | pid:<playlist ID> |
69 | purl:<playlist URL> |
69 | purl:<playlist URL> |
70 | cid:<channel id> |
70 | cid:<channel id> |
71 | cname:<channel name> |
71 | cname:<channel name> |
72 | curl:<channel or username URL> |
72 | curl:<channel or username URL> |
73 | list:<file with resource entries> (comments can be #) |
73 | list:<file with resource entries> (comments can be #) |
74 | search:<searchterm> |
74 | search:<searchterm> |
75 | 75 | ||
76 | For channels (`cid`, `cname`, `curl`) you can also perform a search to filter the results. |
76 | For channels (`cid`, `cname`, `curl`) you can also perform a search to filter the results. |
77 | This can be done like this: `cname:[search="Elvis Presley"]channel_1234` |
77 | This can be done like this: `cname:[search="Elvis Presley"]channel_1234` |
78 | For the search option, following parameters are possible: `search:[order=date][maxresults=50]"Elvis Presley"` |
78 | For the search option, following parameters are possible: `search:[order=date][maxresults=50]"Elvis Presley"` |
79 | Acceptable order values are: `date`, `rating`, `relevance`, `title`, `videoCount`, `viewCount` |
79 | Acceptable order values are: `date`, `rating`, `relevance`, `title`, `videoCount`, `viewCount` |
80 | Default values are `order=relevance` and `maxresults=10` |
80 | Default values are `order=relevance` and `maxresults=10` |
81 | Use `maxresults=-1` to download everything which matches the searchterm. |
81 | Use `maxresults=-1` to download everything which matches the searchterm. |
82 | 82 | ||
83 | ## Requirements |
83 | ## Requirements |
84 | - PHP CLI |
84 | - PHP CLI |
85 | - A YouTube API key (can be obtained here: https://console.developers.google.com/apis/credentials ) |
85 | - A YouTube API key (can be obtained here: https://console.developers.google.com/apis/credentials ) |
86 | - If you want to extract audio, you need additionally: ffmpeg or avconv and ffprobe or avprobe. |
86 | - If you want to extract audio, you need additionally: ffmpeg or avconv and ffprobe or avprobe. |
87 | - Optional: package "id3v2" to allow the YouTube video id to be transferred to the MP3 ID tag |
87 | - Optional: package "id3v2" to allow the YouTube video id to be transferred to the MP3 ID tag |
88 | 88 | ||
89 | ## Age restricted videos how-to |
89 | ## Age restricted videos how-to |
90 | 90 | ||
91 | To download age restricted videos, you need to supply cookies from a browser that has been logged in to YouTube. |
91 | To download age restricted videos, you need to supply cookies from a browser that has been logged in to YouTube. |
92 | 92 | ||
93 | **Here is a method how to do this:** |
93 | **Here is a method how to do this:** |
94 | 94 | ||
95 | (1) Download and install this Chrome extension: |
95 | (1) Download and install this Chrome extension: |
96 | https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg/related |
96 | https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg/related |
97 | 97 | ||
98 | (2) If you cannot see the Cookie-Button at the right top, then click the plugin button, and then enable "pinning" for the plugin "cookie.txt". |
98 | (2) If you cannot see the Cookie-Button at the right top, then click the plugin button, and then enable "pinning" for the plugin "cookie.txt". |
99 | 99 | ||
100 | (3) Login to YouTube at the same network where the YouTube Downloader will run. |
100 | (3) Login to YouTube at the same network where the YouTube Downloader will run. |
101 | Press the cookie plugin button and copy the contents to a file called cookies.txt |
101 | Press the cookie plugin button and copy the contents to a file called cookies.txt |
102 | 102 | ||
103 | (4) Edit cookies.txt and add following comment at the very top: `# HTTP Cookie File` |
103 | (4) Edit cookies.txt and add following comment at the very top: `# HTTP Cookie File` |
104 | 104 | ||
105 | (5) Rename and move the file to **~/.yt_cookies** |
105 | (5) Rename and move the file to **~/.yt_cookies** |
106 | OR |
106 | OR |
107 | Add the argument `--cookies=cookies.txt` to ytdwn. |
107 | Add the argument `--cookies=cookies.txt` to ytdwn. |
108 | 108 | ||
109 | ## License |
109 | ## License |
110 | 110 | ||
111 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
111 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
112 | 112 | ||
113 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
113 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |