Quellcode durchsuchen

added album-backup wip

Harlan Iverson vor 7 Jahren
Ursprung
Commit
4eb7d03720
42 geänderte Dateien mit 1536 neuen und 0 gelöschten Zeilen
  1. 1 0
      album-backup/.dockerignore
  2. 1 0
      album-backup/.gitignore
  3. 12 0
      album-backup/app/.gitignore
  4. 15 0
      album-backup/app/project.clj
  5. 8 0
      album-backup/app/resources/templates/asc/pages/adoc-page.asc
  6. 44 0
      album-backup/app/resources/templates/asc/posts/2014-10-10-adoc-post.asc
  7. 0 0
      album-backup/app/resources/templates/assets/videojs/video-js.css
  8. 0 0
      album-backup/app/resources/templates/assets/videojs/video.js
  9. 0 0
      album-backup/app/resources/templates/assets/videojs/videojs-contrib-hls.js
  10. 0 0
      album-backup/app/resources/templates/assets/videojs/videojs-contrib-quality-levels.js
  11. 553 0
      album-backup/app/resources/templates/assets/videojs/videojs-media-session.js
  12. 70 0
      album-backup/app/resources/templates/assets/videojs/videojs-playbackrate-adjuster.js
  13. 32 0
      album-backup/app/resources/templates/config.edn
  14. 3 0
      album-backup/app/resources/templates/css/example.css
  15. 5 0
      album-backup/app/resources/templates/css/sassexample.scss
  16. BIN
      album-backup/app/resources/templates/img/cryogen.png
  17. 8 0
      album-backup/app/resources/templates/md/pages/about.md
  18. 8 0
      album-backup/app/resources/templates/md/pages/another-page.md
  19. 14 0
      album-backup/app/resources/templates/md/video-page.md
  20. 168 0
      album-backup/app/resources/templates/themes/blue/css/screen.css
  21. 40 0
      album-backup/app/resources/templates/themes/blue/html/404.html
  22. 20 0
      album-backup/app/resources/templates/themes/blue/html/archives.html
  23. 19 0
      album-backup/app/resources/templates/themes/blue/html/author.html
  24. 101 0
      album-backup/app/resources/templates/themes/blue/html/base.html
  25. 20 0
      album-backup/app/resources/templates/themes/blue/html/home.html
  26. 23 0
      album-backup/app/resources/templates/themes/blue/html/page.html
  27. 21 0
      album-backup/app/resources/templates/themes/blue/html/post-content.html
  28. 32 0
      album-backup/app/resources/templates/themes/blue/html/post.html
  29. 28 0
      album-backup/app/resources/templates/themes/blue/html/previews.html
  30. 16 0
      album-backup/app/resources/templates/themes/blue/html/tag.html
  31. 15 0
      album-backup/app/resources/templates/themes/blue/html/tags.html
  32. 1 0
      album-backup/app/resources/templates/themes/blue/js/highlight.pack.js
  33. 8 0
      album-backup/app/src/cryogen/core.clj
  34. 32 0
      album-backup/app/src/cryogen/server.clj
  35. 0 0
      album-backup/doc/operations.md
  36. 28 0
      album-backup/readme.md
  37. 25 0
      album-backup/scripts/download-playlist.sh
  38. 9 0
      album-backup/scripts/extract-audio.sh
  39. 5 0
      album-backup/scripts/extract-metadata.sh
  40. 24 0
      album-backup/scripts/make-video-page.sh
  41. 36 0
      album-backup/scripts/post-for-video.sh
  42. 91 0
      album-backup/scripts/transcode-video.sh

+ 1 - 0
album-backup/.dockerignore

@@ -0,0 +1 @@
+media

+ 1 - 0
album-backup/.gitignore

@@ -0,0 +1 @@
+media

+ 12 - 0
album-backup/app/.gitignore

@@ -0,0 +1,12 @@
+pom.xml
+pom.xml.asc
+*jar
+/lib/
+/classes/
+/target/
+/checkouts/
+.lein-deps-sum
+.lein-repl-history
+.lein-plugins/
+.lein-failures
+/resources/public/

+ 15 - 0
album-backup/app/project.clj

@@ -0,0 +1,15 @@
+(defproject cryogen "0.1.0"
+            :description "Simple static site generator"
+            :url "https://github.com/lacarmen/cryogen"
+            :license {:name "Eclipse Public License"
+                      :url "http://www.eclipse.org/legal/epl-v10.html"}
+            :dependencies [[org.clojure/clojure "1.8.0"]
+                           [ring/ring-devel "1.6.3"]
+                           [compojure "1.6.0"]
+                           [ring-server "0.5.0"]
+                           [cryogen-markdown "0.1.7"]
+                           [cryogen-core "0.1.61"]]
+            :plugins [[lein-ring "0.9.7"]]
+            :main cryogen.core
+            :ring {:init cryogen.server/init
+                   :handler cryogen.server/handler})

+ 8 - 0
album-backup/app/resources/templates/asc/pages/adoc-page.asc

@@ -0,0 +1,8 @@
+{:title "Adoc Page"
+ :layout :page
+ :page-index 0
+ :navbar? true}
+
+== Adoc Page ==
+
+We support http://asciidoc.org/[asciidoc] too!

+ 44 - 0
album-backup/app/resources/templates/asc/posts/2014-10-10-adoc-post.asc

@@ -0,0 +1,44 @@
+{:title "Adoc Post"
+ :layout :post
+ :tags  ["cryogen" "asciidoc"]
+ :toc false
+}
+
+:toc: macro
+
+== Example Asciidoc Post ==
+This is an example asciidoc post.
+
+You can use a manually placed table of contents by setting `:toc false` in the front matter, but use `:toc: macro` at the top of the post, and `toc::[]` where the table of contents is supposed to be, like here:
+
+toc::[]
+
+=== Section 1 ===
+
+.Heading
+
+With some text and maybe even a bulleted list:  
+
+- Thing 1  
+- Thing 2  
+
+Or how about some *bold* or _italicized_ text?
+
+=== Section 2 ===
+
+Will a code snippet work?  
+
+.bash
+[source,bash]
+----
+$ echo "foo"
+----
+
+.clojure
+[source,clojure]
+----
+(defn echo [s]
+  (println s))
+----
+
+

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
album-backup/app/resources/templates/assets/videojs/video-js.css


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
album-backup/app/resources/templates/assets/videojs/video.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
album-backup/app/resources/templates/assets/videojs/videojs-contrib-hls.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
album-backup/app/resources/templates/assets/videojs/videojs-contrib-quality-levels.js


Datei-Diff unterdrückt, da er zu groß ist
+ 553 - 0
album-backup/app/resources/templates/assets/videojs/videojs-media-session.js


Datei-Diff unterdrückt, da er zu groß ist
+ 70 - 0
album-backup/app/resources/templates/assets/videojs/videojs-playbackrate-adjuster.js


+ 32 - 0
album-backup/app/resources/templates/config.edn

@@ -0,0 +1,32 @@
+{:site-title           "My Awesome Blog"
+ :author               "Bob Bobbert"
+ :description          "This blog is awesome"
+ :site-url             "http://blogawesome.com/"
+ :post-root            "posts"
+ :page-root            "pages"
+ :post-root-uri        "posts-output"
+ :page-root-uri        "pages-output"
+ :tag-root-uri         "tags-output"
+ :author-root-uri      "authors-output"
+ :blog-prefix          "/blog"
+ :rss-name             "feed.xml"
+ :rss-filters          ["cryogen"]
+ :recent-posts         3
+ :post-date-format     "yyyy-MM-dd"
+ :archive-group-format "yyyy MMMM"
+ :sass-src             []
+ :sass-path            "sass"
+ :compass-path         "compass"
+ :theme                "blue"
+ :resources            ["img"]
+ :keep-files           [".git"]
+ :disqus?              false
+ :disqus-shortname     ""
+ :ignored-files        [#"\.#.*" #".*\.swp$"]
+ :posts-per-page       5
+ :blocks-per-preview   2
+ :previews?            false
+ :clean-urls?          true
+ :hide-future-posts?   true
+ :klipse               {}
+ :debug?               false}

+ 3 - 0
album-backup/app/resources/templates/css/example.css

@@ -0,0 +1,3 @@
+a {
+    text-decoration-style: dashed;
+}

+ 5 - 0
album-backup/app/resources/templates/css/sassexample.scss

@@ -0,0 +1,5 @@
+body {
+    a {
+        text-decoration-style: dashed;
+    }
+}

BIN
album-backup/app/resources/templates/img/cryogen.png


+ 8 - 0
album-backup/app/resources/templates/md/pages/about.md

@@ -0,0 +1,8 @@
+{:title "About"
+ :layout :page
+ :page-index 0
+ :navbar? true}
+
+## Write something about something
+
+wow wow wow

+ 8 - 0
album-backup/app/resources/templates/md/pages/another-page.md

@@ -0,0 +1,8 @@
+{:title "Another Page"
+ :layout :page
+ :page-index 1}
+
+## Look at this sweet page
+
+this is another custom page
+totally not a post

+ 14 - 0
album-backup/app/resources/templates/md/video-page.md

@@ -0,0 +1,14 @@
+{:title "$TITLE"
+ :layout :video
+ :tags ["video"]
+ :video-thumbnail-url "$THUMBNAIL"
+ :video-url "$HLS"
+ :video-description "$DESCRIPTION"
+ }
+
+# $TITLE
+ 
+### by $ARTIST
+
+$DESCRIPTION
+

+ 168 - 0
album-backup/app/resources/templates/themes/blue/css/screen.css

@@ -0,0 +1,168 @@
+h1, h2, h3, h4, h5, h6 {
+    font-family: 'Alegreya';
+}
+
+body {
+    color: #333;
+    background-color: #f2f2f2;
+    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
+    font-size: 16px;
+}
+
+.container {
+    max-width: 1000px;
+}
+
+.right {
+    float: right;
+    text-align: right;
+}
+
+.navbar {
+    border-radius: 0;
+    box-shadow: 0 0 0 0,0 6px 12px rgba(34,34,34,0.3);
+}
+
+.navbar-default {
+    background-color: #428bca;
+    border: none;
+}
+
+.navbar-default .navbar-brand {
+    color: #fff;
+    font-family: 'Alegreya';
+}
+
+.navbar-default .navbar-brand:hover {
+    color: #fff;
+}
+
+.navbar-default .navbar-nav li a {
+    color: #fff;
+}
+
+.navbar-default .navbar-nav li a:hover {
+    color: #fff;
+    background-color: #3d80ba;
+}
+
+.navbar-default .navbar-nav .active a {
+    color: #fff;
+    background-color: #3d80ba;
+}
+
+.navbar-default .navbar-toggle:hover{
+    background-color: #3d80ba;
+}
+
+.navbar-default .navbar-toggle .icon-bar {
+    background-color: #fff;
+}
+
+#sidebar {
+    margin-left: 15px;
+    margin-top: 50px;
+}
+
+#content {
+    background-color: #fff;
+    border-radius: 3px;
+    box-shadow: 0 0 0 0,0 6px 12px rgba(34,34,34,0.1);
+}
+
+#content img {
+    max-width: 100%;
+    height: auto;
+}
+
+footer {
+    font-size: 14px;
+    text-align: center;
+    padding-top: 75px;
+    padding-bottom: 30px;
+}
+
+blockquote footer {
+    text-align: left;
+    padding-top: 0px;
+    padding-bottom: 0px;
+}
+
+#post-tags {
+    margin-top: 30px;
+}
+
+#prev-next {
+    padding: 15px 0;
+}
+
+.post-header {
+    margin-bottom: 20px;
+}
+.post-header h2 {
+    font-size: 32px;
+}
+
+#post-meta {
+    font-size: 14px;
+    color: rgba(0,0,0,0.4)
+}
+
+#page-header {
+    border-bottom: 1px solid #dbdbdb;
+    margin-bottom: 20px;
+}
+#page-header h2 {
+    font-size: 32px;
+}
+
+pre {
+    overflow-x: auto;
+}
+pre code {
+    display: block;
+    padding: 0.5em;
+    overflow-wrap: normal;
+    white-space: pre;
+}
+
+code {
+    color: #428bca;
+}
+
+pre, code, .hljs {
+    background-color: #f7f9fd;
+}
+
+@media (min-width: 768px) {
+    .navbar {
+        min-height: 70px;
+    }
+    .navbar-nav>li>a {
+        padding: 30px 20px;
+    }
+    .navbar-default .navbar-brand {
+        font-size: 36px;
+        padding: 25px 15px;
+    }
+    #content{
+        margin-top: 30px;
+        padding: 30px 40px;
+    }
+}
+
+@media (max-width: 767px) {
+    body{
+        font-size: 14px;
+    }
+    .navbar-default .navbar-brand {
+        font-size: 30px;
+    }
+    #content{
+        padding: 15px;
+    }
+    #post-meta .right {
+        float:left;
+        text-align: left;
+    }
+}

+ 40 - 0
album-backup/app/resources/templates/themes/blue/html/404.html

@@ -0,0 +1,40 @@
+<html>
+    <head>
+        <style>        
+        #message{
+               display:block;
+               width:100%;
+               padding:150px 0;
+               line-height:1.6em;
+               text-align:center;
+            }
+        h1, h2 {            
+               color: rgb(151, 151, 151);                
+               float: left;
+               margin:0 0 0 40px;
+               padding:0;
+               float:left;
+               font-family: Georgia, 'Times New Roman', Times, serif;               
+               font-weight: normal;               
+               line-height: normal;                                
+               text-transform: uppercase;
+        }
+        #message .aside{display:block; width:80%; margin:0 auto; padding:0;}        
+        #message .aside h2 span{display:block; font-size:30px;}        
+        #message p:first-child{margin-top:0;}
+        h1 {margin-top:-90px; font-size:200px;}
+        h2 {font-size: 60px;}
+        </style>    
+    </head>
+    <body>
+        <div class="content">          
+            <section id="message">
+              <div class="aside">
+                <h1>404</h1>
+                <h2>Error ! <span>Page Not Found</span></h2>
+              </div>
+            </section>
+        </div>
+    </body>
+</html>
+

+ 20 - 0
album-backup/app/resources/templates/themes/blue/html/archives.html

@@ -0,0 +1,20 @@
+{% extends "/html/base.html" %}
+{%block subtitle %}: Archives{% endblock %}
+{% block content %}
+<div id="posts">
+    <div id="page-header">
+        <h2>Archives</h2>
+    </div>
+    {% for group in groups %}
+        <h4>{{group.group}}</h4>
+        <ul>
+        {% for post in group.posts %}
+        <li>
+            {{post.date|date:"MMM dd"}} - <a href="{{post.uri}}">{{post.title}}</a>
+        </li>
+        {% endfor %}
+        </ul>
+    {% endfor %}
+
+</div>
+{% endblock %}

+ 19 - 0
album-backup/app/resources/templates/themes/blue/html/author.html

@@ -0,0 +1,19 @@
+{% extends "/html/base.html" %}
+{%block subtitle %}: Posts by {{author}} {% endblock %}
+{% block content %}
+<div id="posts">
+  <div id="page-header" class="post-header">
+    <h2>Posts by {{author}}</h2>
+  </div>
+  {% for group in groups %}
+  <h4>{{group.group}}</h4>
+  <ul>
+    {% for post in group.posts %}
+    <li>
+      {{post.date|date:"MMM dd"}} - <a href="{{post.uri}}">{{post.title}}</a>
+    </li>
+    {% endfor %}
+  </ul>
+  {% endfor %}
+</div>
+{% endblock %}

+ 101 - 0
album-backup/app/resources/templates/themes/blue/html/base.html

@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+    <meta charset="utf-8"/>
+    <title>{{title}}{% block subtitle %}{% endblock %}</title>
+    <link rel="canonical" href="{{site-url}}{{uri}}">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link href="//fonts.googleapis.com/css?family=Alegreya:400italic,700italic,400,700" rel="stylesheet"
+          type="text/css">
+    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
+    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
+    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/styles/default.min.css">
+    {% style "css/screen.css" %}
+</head>
+<body>
+
+
+<nav class="navbar navbar-default">
+    <div class="container">
+        <div class="navbar-header">
+            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
+                <span class="sr-only">Toggle navigation</span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+            </button>
+            <a class="navbar-brand" href="{{index-uri}}">{{title}}</a>
+        </div>
+        <div id="navbar" class="navbar-collapse collapse">
+            <ul class="nav navbar-nav navbar-right">
+                <li {% if home %} class="active" {% endif %}><a href="{{index-uri}}">Home</a></li>
+                <li
+                {% if archives %} class="active" {% endif %}><a href="{{archives-uri}}">Archives</a></li>
+                {% for nav-page in navbar-pages %}
+                <li
+                {%ifequal page.uri nav-page.uri %} class="active" {% endifequal %}>
+                <a href="{{nav-page.uri}}">{{nav-page.title}}</a>
+                </li>
+                {% endfor %}
+                <li><a href="{{rss-uri}}">RSS</a></li>
+            </ul>
+        </div><!--/.nav-collapse -->
+    </div><!--/.container-fluid -->
+</nav>
+
+
+<div class="container">
+
+
+    <div class="row">
+        <div class="col-lg-9">
+            <div id="content">
+                {% block content %}
+                {% endblock %}
+            </div>
+        </div>
+
+        <div class="col-md-3">
+            <div id="sidebar">
+                <h3>Links</h3>
+                <ul id="links">
+                    <li><a href="http://cryogenweb.org/docs/home.html">Cryogen Docs</a></li>
+                    <li><a href="http://carmenla.me/blog/archives">Carmen's Blog</a></li>
+                    {% for page in sidebar-pages %}
+                    <li><a href="{{page.uri}}">{{page.title}}</a></li>
+                    {% endfor %}
+                </ul>
+                {% if latest-posts|not-empty %}
+                <div id="recent">
+                    <h3>Recent Posts</h3>
+                    <ul>
+                        {% for post in latest-posts %}
+                        <li><a href="{{post.uri}}">{{post.title}}</a></li>
+                        {% endfor %}
+                    </ul>
+                </div>
+                {% endif %}
+                {% if tags|not-empty %}
+                <div id="tags">
+                    <h3>Tags</h3>
+                    <ul>
+                        {% for tag in tags %}
+                        <li><a href="{{tag.uri}}">{{tag.name}}</a></li>
+                        {% endfor %}
+                    </ul>
+                </div>
+                {% endif %}
+            </div>
+        </div>
+    </div>
+    <footer>Copyright &copy; {{today|date:yyyy}} {{author}}
+        <p style="text-align: center;">Powered by <a href="http://cryogenweb.org">Cryogen</a></p></footer>
+</div>
+<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
+<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
+{% script "js/highlight.pack.js" %}
+<script>hljs.initHighlightingOnLoad();</script>
+{% if post.klipse %} {{post.klipse|safe}} {% endif %}
+{% if page.klipse %} {{page.klipse|safe}} {% endif %}
+</body>
+</html>

+ 20 - 0
album-backup/app/resources/templates/themes/blue/html/home.html

@@ -0,0 +1,20 @@
+{% extends "/html/base.html" %}
+{% block content %}
+<div id="post">
+    {% include "/html/post-content.html" %}
+    {% if disqus? %}
+    <div id="comments">
+        <a href="{{post.uri}}#disqus_thread">View Comments</a>
+    </div>
+    {% endif %}
+
+    <div id="prev-next">
+        {% if post.prev %}
+        <a href="{{post.prev.uri}}">&laquo; {{post.prev.title}}</a>
+        {% endif %}
+        {% if post.next %}
+        <a class="right" href="{{post.next.uri}}">{{post.next.title}} &raquo;</a>
+        {% endif %}
+    </div>
+</div>
+{% endblock %}

+ 23 - 0
album-backup/app/resources/templates/themes/blue/html/page.html

@@ -0,0 +1,23 @@
+{% extends "/html/base.html" %}
+{%block subtitle %}: {{page.title}}{% endblock %}
+{% block content %}
+<div id="custom-page">
+    <div id="page-header">
+        <h2>{{page.title}}</h2>
+    </div>
+    {% if page.toc %}{{page.toc|safe}}{% endif %}
+    {{page.content|safe}}
+
+    <div id="prev-next">
+        {% if page.prev %}
+        <a href="{{page.prev.uri}}">&laquo; {{page.prev.title}}</a>
+        {% endif %}
+        {% if all page.prev page.next %}
+        ||
+        {% endif %}
+        {% if page.next %}
+        <a href="{{page.next.uri}}">{{page.next.title}} &raquo;</a>
+        {% endif %}
+    </div>
+</div>
+{% endblock %}

+ 21 - 0
album-backup/app/resources/templates/themes/blue/html/post-content.html

@@ -0,0 +1,21 @@
+<div class="post-header">
+    <div id="post-meta" class="row">
+        <div class="col-lg-6">{{post.date|date:longDate}}</div>
+        {% if post.author %}
+        <span class="col-lg-6 right">By: {{post.author}}</span>
+        {% endif %}
+    </div>
+    <h2>{{post.title}}</h2>
+</div>
+<div>
+    {% if post.toc %}{{post.toc|safe}}{% endif %}
+    {{post.content|safe}}
+</div>
+{% if post.tags|not-empty %}
+<div id="post-tags">
+    <b>Tags: </b>
+    {% for tag in post.tags %}
+    <a href="{{tag.uri}}">{{tag.name}}</a>
+    {% endfor %}
+</div>
+{% endif %}

+ 32 - 0
album-backup/app/resources/templates/themes/blue/html/post.html

@@ -0,0 +1,32 @@
+{% extends "/html/base.html" %}
+{%block subtitle %}: {{post.title}}{% endblock %}
+{% block content %}
+<div id="post">
+    {% include "/html/post-content.html" %}
+    <div id="prev-next">
+        {% if post.prev %}
+        <a href="{{post.prev.uri}}">&laquo; {{post.prev.title}}</a>
+        {% endif %}
+        {% if post.next %}
+        <a class="right" href="{{post.next.uri}}">{{post.next.title}} &raquo;</a>
+        {% endif %}
+    </div>
+
+    {% if disqus-shortname %}
+    <div id="disqus_thread"></div>
+    <script type="text/javascript">
+        var disqus_config = function () {
+            this.page.url = "{{site-url}}{{uri}}";
+            this.page.identifier = "{{post.title}}";
+        };
+        (function() {
+            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+            dsq.src = '//{{disqus-shortname}}.disqus.com/embed.js';
+            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+        })();
+    </script>
+    {% endif %}
+
+
+</div>
+{% endblock %}

+ 28 - 0
album-backup/app/resources/templates/themes/blue/html/previews.html

@@ -0,0 +1,28 @@
+{% extends "/html/base.html" %}
+{% block content %}
+<div id="post">
+    {% for post in posts %}
+    <div class="post-header">
+        <h2>{{post.title}}</h2>
+        <div id="post-meta">
+            {% if post.author %}
+            <div class="author">{{post.author}}</div>
+            {% endif %}
+            <div class="date">{{post.date|date:longDate}}</div>
+        </div>
+    </div>
+    {{post.content|safe}}
+    <a href="{{post.uri}}">Continue reading &#8594;</a>
+    <hr>
+    {% endfor %}
+
+    <div id="prev-next">
+        {% if prev-uri %}
+        <a class="left" href="{{prev-uri}}">&laquo; Prev</a>
+        {% endif %}
+        {% if next-uri %}
+        <a class="right" href="{{next-uri}}">Next &raquo;</a>
+        {% endif %}
+    </div>
+</div>
+{% endblock %}

+ 16 - 0
album-backup/app/resources/templates/themes/blue/html/tag.html

@@ -0,0 +1,16 @@
+{% extends "/html/base.html" %}
+{%block subtitle %}: Posts Tagged &quot;{{name}}&quot;{% endblock %}
+{% block content %}
+<div id="posts-by-tag">
+    <div id="page-header">
+        <h2>Posts Tagged &quot;{{name}}&quot;</h2>
+    </div>
+    <ul>
+    {% for post in posts %}
+        <li>
+            <a href="{{post.uri}}">{{post.title}}</a>
+        </li>
+    {% endfor %}
+    </ul>
+</div>
+{% endblock %}

+ 15 - 0
album-backup/app/resources/templates/themes/blue/html/tags.html

@@ -0,0 +1,15 @@
+{% extends "/html/base.html" %}
+{%block subtitle %}: Tags{% endblock %}
+{% block content %}
+<div id="tags-page">
+    <div id="page-header">
+        <h2>Tags</h2>
+    </div>
+
+    <ul>
+        {% for tag in tags %}
+        <li><a href="{{tag.uri}}">{{tag.name}}</a></li>
+        {% endfor %}
+    </ul>
+</div>
+{% endblock %}

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
album-backup/app/resources/templates/themes/blue/js/highlight.pack.js


+ 8 - 0
album-backup/app/src/cryogen/core.clj

@@ -0,0 +1,8 @@
+(ns cryogen.core
+  (:require [cryogen-core.compiler :refer [compile-assets-timed]]
+            [cryogen-core.plugins :refer [load-plugins]]))
+
+(defn -main []
+  (load-plugins)
+  (compile-assets-timed)
+  (System/exit 0))

+ 32 - 0
album-backup/app/src/cryogen/server.clj

@@ -0,0 +1,32 @@
+(ns cryogen.server
+  (:require [compojure.core :refer [GET defroutes]]
+            [compojure.route :as route]
+            [ring.util.response :refer [redirect resource-response]]
+            [ring.util.codec :refer [url-decode]]
+            [cryogen-core.watcher :refer [start-watcher!]]
+            [cryogen-core.plugins :refer [load-plugins]]
+            [cryogen-core.compiler :refer [compile-assets-timed read-config]]
+            [cryogen-core.io :refer [path]]))
+
+(defn init []
+  (load-plugins)
+  (compile-assets-timed)
+  (let [ignored-files (-> (read-config) :ignored-files)]
+    (start-watcher! "resources/templates" ignored-files compile-assets-timed)))
+
+(defn wrap-subdirectories
+  [handler]
+  (fn [request]
+    (let [req-uri (.substring (url-decode (:uri request)) 1)
+          res-path (path req-uri (when (:clean-urls? (read-config)) "index.html"))]
+      (or (resource-response res-path {:root "public"})
+          (handler request)))))
+
+(defroutes routes
+  (GET "/" [] (redirect (let [config (read-config)]
+                          (path (:blog-prefix config) "/"
+                                (when-not (:clean-urls? config) "index.html")))))
+  (route/resources "/")
+  (route/not-found "Page not found"))
+
+(def handler (wrap-subdirectories routes))

+ 0 - 0
album-backup/doc/operations.md


+ 28 - 0
album-backup/readme.md

@@ -0,0 +1,28 @@
+# Album Archive
+
+This project is meant for creators who have a playlist of videos on YouTube that they would like to
+download and archive into a static website, using modern cache-friendly techniques.
+
+See doc/operations.md for usage. Follow Cryogen instructions for details creating the site... scripts
+in this project are geared toward importing and transcoding assets in the media directory.
+
+
+
+
+1. `mkdir media`
+2. `mkdir scripts`
+
+
+
+1. `lein new cryogen app`
+
+3. `mkdir scripts`
+
+
+
+
+copy and adapt scripts from ispooge.com
+
+4. `scripts/start-build.sh`
+
+5

+ 25 - 0
album-backup/scripts/download-playlist.sh

@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PLAYLIST=${1:-"PLD5lYPY-uZpq7x2zRIiULo2oZ-tWs2lPx"}
+DIR=${2:-"media"}
+
+mkdir -p $DIR
+cd $DIR
+
+youtube-dl \
+  --verbose \
+  --playlist-start 1 \
+  --playlist-end 1 \
+  --add-metadata \
+  --no-mark-watched \
+  --yes-playlist \
+  --write-all-thumbnails \
+  --ignore-errors \
+  --all-subs \
+  --no-call-home \
+  --restrict-filenames \
+  "https://www.youtube.com/playlist?list=$PLAYLIST"
+
+
+# very large and detailed
+#  --write-info-json \

+ 9 - 0
album-backup/scripts/extract-audio.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# example, convert all mp4 files in media/ directory:
+#
+# find media -type f -name "*.mp4" | xargs -n1 scripts/extract-audio.sh
+#
+ffmpeg -i $1 -vn -acodec copy $2
+
+exit 0

+ 5 - 0
album-backup/scripts/extract-metadata.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+ffmpeg -i $1 -f ffmetadata $2
+
+

+ 24 - 0
album-backup/scripts/make-video-page.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+
+VIDEO_BASENAME="$1"
+
+VIDEO="$VIDEO_BASENAME.mp4"
+META="$VIDEO_BASENAME.txt"
+THUMBNAIL="$VIDEO_BASENAME.jpg"
+HLS="$VIDEO_BASENAME/playlist.m3u8"
+
+TITLE=$(awk -F "=" '/title/ {print $2}' $META)
+ARTIST=$(awk -F "=" '/artist/ {print $2}' $META)
+DESCRIPTION=$(awk -F "=" '/description/ {print $2}' $META)
+
+ENVSUBST="/usr/local/Cellar/gettext/0.19.8.1/bin/envsubst"
+
+TEMPLATE=app/resources/templates/md/video-page.md
+
+cat $TEMPLATE | \
+DESCRIPTION=$DESCRIPTION \
+ARTIST=$ARTIST \
+TITLE=$TITLE \
+THUMBNAIL=$THUMBNAIL \
+HLS=$HLS \
+$ENVSUBST

+ 36 - 0
album-backup/scripts/post-for-video.sh

@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# example, convert all mp4 files in media/ directory:
+#
+# find media -type f -name "*.mp4" | xargs -n1 scripts/post-for-video.sh
+#
+
+vid=$1
+base=${vid%????}
+id=$(basename $base)
+
+hls=${base}
+meta=${base}.txt
+  
+if [ ! -d $hls ]; then
+ echo "transcode: "
+ scripts/transcode-video.sh $vid $hls
+fi
+
+if [ ! -f $meta ]; then
+ echo "extract meta:: "
+ scripts/extract-metadata.sh $vid $meta
+fi
+
+rawdate=$(awk -F "=" '/date/ {print $2}' $meta)
+date="${rawdate:0:4}-${rawdate:4:2}-${rawdate:6:2}"
+
+
+posts="app/resources/templates/md/posts"
+post="${posts}/${date}-${id}.md"
+
+scripts/make-video-page.sh $base > $post
+
+echo "wrote $post"
+
+exit 0

+ 91 - 0
album-backup/scripts/transcode-video.sh

@@ -0,0 +1,91 @@
+#!/usr/bin/env bash
+
+# https://gist.github.com/mrbar42/ae111731906f958b396f30906004b3fa
+
+set -e
+
+# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
+[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
+
+FFMPEG=ffmpeg
+
+# comment/add lines here to control which renditions would be created
+renditions=(
+# resolution  bitrate  audio-rate
+#  "426x240    400k    64k"
+  "640x360    800k     96k"
+#  "842x480    1400k    128k"
+#  "1280x720   2800k    128k"
+#  "1920x1080  5000k    192k"
+)
+
+segment_target_duration=2       # try to create a new segment every X seconds
+max_bitrate_ratio=1.07          # maximum accepted bitrate fluctuations
+rate_monitor_buffer_ratio=1.5   # maximum buffer size between bitrate conformance checks
+
+#########################################################################
+
+source="${1}"
+target="${2}"
+if [[ ! "${target}" ]]; then
+  target="${source##*/}" # leave only last component of path
+  target="${target%.*}"  # strip extension
+fi
+mkdir -p ${target}
+
+
+key_frames_interval="$(echo `ffprobe ${source} 2>&1 | grep -oE '[[:digit:]]+(.[[:digit:]]+)? fps' | grep -oE '[[:digit:]]+(.[[:digit:]]+)?'`*2 | bc || echo '')"
+key_frames_interval=${key_frames_interval:-50}
+key_frames_interval=$(echo `printf "%.1f\n" $(bc -l <<<"$key_frames_interval/10")`*10 | bc) # round
+key_frames_interval=${key_frames_interval%.*} # truncate to integer
+
+# static parameters that are similar for all renditions
+static_params="-c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -strict -2"
+static_params+=" -g ${key_frames_interval} -keyint_min ${key_frames_interval} -force_key_frames expr:gte(t,n_forced*2) -hls_time ${segment_target_duration}"
+
+# not working w current
+#static_params+=" -hls_playlist_type vod"
+static_params+=" -hls_list_size 0"
+
+
+
+# misc params
+misc_params="-hide_banner -y"
+
+master_playlist="#EXTM3U
+#EXT-X-VERSION:3
+"
+cmd=""
+for rendition in "${renditions[@]}"; do
+  # drop extraneous spaces
+  rendition="${rendition/[[:space:]]+/ }"
+
+  # rendition fields
+  resolution="$(echo ${rendition} | cut -d ' ' -f 1)"
+  bitrate="$(echo ${rendition} | cut -d ' ' -f 2)"
+  audiorate="$(echo ${rendition} | cut -d ' ' -f 3)"
+
+  # calculated fields
+  width="$(echo ${resolution} | grep -oE '^[[:digit:]]+')"
+  height="$(echo ${resolution} | grep -oE '[[:digit:]]+$')"
+  maxrate="$(echo "`echo ${bitrate} | grep -oE '[[:digit:]]+'`*${max_bitrate_ratio}" | bc)"
+  bufsize="$(echo "`echo ${bitrate} | grep -oE '[[:digit:]]+'`*${rate_monitor_buffer_ratio}" | bc)"
+  bandwidth="$(echo ${bitrate} | grep -oE '[[:digit:]]+')000"
+  name="${height}p"
+
+  cmd+=" ${static_params} -vf scale=w=${width}:h=${height}"  # :force_original_aspect_ratio=decrease
+  cmd+=" -b:v ${bitrate} -maxrate ${maxrate%.*}k -bufsize ${bufsize%.*}k -b:a ${audiorate}"
+  cmd+=" -hls_segment_filename ${target}/${name}_%03d.ts ${target}/${name}.m3u8"
+
+  # add rendition entry in the master playlist
+  master_playlist+="#EXT-X-STREAM-INF:BANDWIDTH=${bandwidth},RESOLUTION=${resolution}\n${name}.m3u8\n"
+done
+
+# start conversion
+echo -e "Executing command:\n${FFMPEG} ${misc_params} -i ${source} ${cmd}"
+$FFMPEG ${misc_params} -i ${source} ${cmd}
+
+# create master playlist file
+echo -e "${master_playlist}" > ${target}/playlist.m3u8
+
+echo "Done - encoded HLS is at ${target}/"

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.