diff options
author | 2017-11-28 12:50:30 -0400 | |
---|---|---|
committer | 2017-11-28 13:03:11 -0400 | |
commit | ede2198520dded21d580a9c199a0909c2b04923a (patch) | |
tree | dcc6f2fb2bfc40278c53ffac93bf61773a7553a4 /doc/todo | |
parent | 938c89ec2a3b28c577dffd18a301915a609d6cae (diff) |
add Utility.HtmlDetect
This will be used in youtube-dl integration, to tell when a html page has
been downloaded by addurl, in which case it is worth running youtube-dl
to see if it can extract media from it.
tagsoup is an almost free dependency, because yesod depends on it.
So, this only really adds a dep when git-annex is built without the
webapp.
I'd like this to as closely as possible match how browsers decide if a
page is html or not. Unfortunately, that is fairly heuristic, in order
to support malformed html. And, we don't want to falsely detect
something as html just because it has something that looks like a html
tag embedded somewhere in it. Probably any major video hosting site is
going to be serving html documents that at least start with a <html>
tag, so requiring that or a DOCTYPE should be good enough.
This commit was sponsored by Jeff Goeke-Smith on Patreon.
Diffstat (limited to 'doc/todo')
-rw-r--r-- | doc/todo/switch_from_quvi_to_youtube-dl.mdwn | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/todo/switch_from_quvi_to_youtube-dl.mdwn b/doc/todo/switch_from_quvi_to_youtube-dl.mdwn index cfdd8a8a6..82d61804a 100644 --- a/doc/todo/switch_from_quvi_to_youtube-dl.mdwn +++ b/doc/todo/switch_from_quvi_to_youtube-dl.mdwn @@ -23,6 +23,14 @@ Both of those changes would need changes to user's workflows and cron jobs. git-annex could keep supporting quvi for some time, and warn when it uses quvi, to help with the transition. +> Alternatively, git-annex addurl could download the url first, and then +> check the file to see if it looks like html. If so, run youtube-dl (which +> unfortunately has to download it again) and see if it manages to rip +> media from it. This way, addurl of non-html files does not have extra +> overhead, and the redundant download is fairly small compared to ripping +> the media. Only the unusual case where addurl is being used on html that +> does not contain media becomes more expensive. + Another gotcha is playlists. youtube-dl downloads playlists automatically. But, git-annex needs to record an url that downloads a single file so that `git annex get` works right. So, playlists will need to be disabled when |