Rev 9 | Rev 16 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
9 | daniel-mar | 1 | |
14 | daniel-mar | 2 | # ViaThinkSoft YouTube Downloader Util 2.3 |
9 | daniel-mar | 3 | |
4 | ## Syntax |
||
5 | |||
6 | ./ytdwn [-t|--type v:[ext]|a:[ext]] (default v:) |
||
7 | [-o|--outputDir <dir>] (default current working directory) |
||
8 | [-a|--alreadyDownloaded <file>] |
||
9 | [-f|--failList <file> <treshold>] (This file logs failures) |
||
10 | [-F|--failTreshold <num>] (Don't download if failure (-f) treshold is reached. Default: 3) |
||
11 | [-V|--version] (shows version) |
||
12 | [-v|--verbose] (displays verbose information to STDOUT) |
||
13 | [-h|--help] (shows help) |
||
14 | [-N|--no-mp3-tagtransfer] (disables transfer of video ID to MP3 ID tag) |
||
15 | (This feature requires the package "id3v2") |
||
14 | daniel-mar | 16 | [-H|--checksumMode] (Which checksum files shall be written for new files. |
17 | Must be 'None', 'MD5', 'SFV', or 'MD5,SFV') |
||
9 | daniel-mar | 18 | [-T|--default-template <t>] (Sets default filename template.) |
19 | (Default: '%(title)s-%(id)s.%(ext)s') |
||
20 | [-X|--extra-args <args>] (Additional arguments passed through) |
||
21 | (youtube-dl. Default "-ic") |
||
22 | [-A|--api-key <file|key>] (specifies the API key, or a file containing the API key) |
||
23 | (Default: ~/.yt_api_key) |
||
24 | [--cookies=<file>] A netscape compatible cookie file (for age restricted videos) |
||
25 | (Default: ~/.yt_cookkies) |
||
26 | [-C|--resultcache <file>] (allows video results to be cached in this file) |
||
27 | (only for playlists or channels) |
||
28 | [-O|--create-outputdir] (allows creation of the output directories, recursively) |
||
29 | [--] |
||
30 | <resource> [<resource> ...] |
||
31 | |||
32 | For all paths (outputDir, alreadyDownloaded, apikey, failList and resultcache), you can use the |
||
33 | term '[listname]' which will be replaced by the basename of the current list file (without file extension). |
||
34 | For example you can do following: |
||
35 | |||
36 | ./ytdwn -o 'downloads/[listname]' -- list:*.list |
||
37 | |||
38 | If no list file is processed, it will be replaced with nothing. |
||
39 | |||
40 | The "alreadyDownloaded" argument contains a file which will be managed by ytdwn. |
||
41 | It will contain all video IDs which have been downloaded. This allows you to |
||
42 | move away the already downloaded files, and ytdwn will not download them again. |
||
43 | |||
44 | Examples for type: |
||
45 | - `v:` = best video quality |
||
46 | - `a:` = best audio only |
||
47 | - `a:mp3` = audio only, mp3 |
||
48 | - Valid audio formats according to "man youtube-dl" are |
||
49 | "best", "aac", "flac", "mp3", "m4a", "opus", "vorbis", or "wav"; "best" by default |
||
50 | |||
51 | A `<resource>` can be one of the following: |
||
52 | |||
53 | vid:<video ID> |
||
54 | vurl:<youtube video URL> |
||
55 | pid:<playlist ID> |
||
56 | purl:<playlist URL> |
||
57 | cid:<channel id> |
||
58 | cname:<channel name> |
||
59 | curl:<channel or username URL> |
||
60 | list:<file with resource entries> (comments can be #) |
||
61 | search:<searchterm> |
||
62 | |||
63 | For channels (`cid`, `cname`, `curl`) you can also perform a search to filter the results. |
||
64 | This can be done like this: `cname:[search="Elvis Presley"]channel_1234` |
||
65 | For the search option, following parameters are possible: `search:[order=date][maxresults=50]"Elvis Presley"` |
||
66 | Acceptable order values are: `date`, `rating`, `relevance`, `title`, `videoCount`, `viewCount` |
||
67 | Default values are `order=relevance` and `maxresults=10` |
||
68 | Use `maxresults=-1` to download everything which matches the searchterm. |
||
69 | |||
70 | ## Requirements |
||
71 | - PHP CLI |
||
72 | - Package "youtube-dl" (ytdwn will try to download it automatically, if possible) |
||
73 | - A YouTube API key (can be obtained here: https://console.developers.google.com/apis/credentials ) |
||
74 | - If you want to extract audio, you need additionally: ffmpeg or avconv and ffprobe or avprobe. |
||
75 | - Optional: package "id3v2" to allow the YouTube video id to be transferred to the MP3 ID tag |
||
76 | |||
77 | ## Age restricted videos how-to |
||
78 | |||
79 | To download age restricted videos, you need to supply cookies from a browser that has been logged in to YouTube. |
||
80 | |||
81 | **Here is a method how to do this:** |
||
82 | |||
83 | (1) Download and install this Chrome extension: |
||
84 | https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg/related |
||
85 | |||
86 | (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". |
||
87 | |||
88 | (3) Login to YouTube at the same network where the YouTube Downloader will run. |
||
89 | Press the cookie plugin button and copy the contents to a file called cookies.txt |
||
90 | |||
91 | (4) Edit cookies.txt and add following comment at the very top: `# HTTP Cookie File` |
||
92 | |||
93 | (5) Rename and move the file to **~/.yt_cookies** |
||
94 | OR |
||
95 | Add the argument `--cookies=cookies.txt` to ytdwn. |
||
96 | |||
97 | ## License |
||
98 | |||
99 | 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. |
||
100 | |||
101 | 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. |