
* TypeScriptで作り直した
* UIを変更した
* ダウンロード手順を変更した
* 動画もダウンロードできるようにした
* 結果的にけっこう安定した
利用規約をきちんと読んで法的なルールを守ってご利用ください。
そもそも、音源のダウンロードできる動画も増えてきたので可能ならばそちらをご利用していただきたいですね。

jz.zip.pack({
files: files,
level: 5
})
.done(function(buffer){})
.fail(function(err){});
jz.zip.unpack({
buffer: buffer,
encoding: 'cp932'
})
.done(function(reader){})
.fail(function(err){});setRoutes = (routes) ->
for own routeName, route of routes
for own method of route
app[method] routeName, route[method]
setRoutes
'/admin*':
all: auth.ensureAuthenticated(failureRedirect: '/login')
setRoutes
'/':
get: (req, res) ->
res.send req.query.page
'/entry/:name':
get: (req, res) ->
res.send req.params.name
'/tag/:name':
get: (req, res) ->
res.send req.params.name
'/login':
get: (req, res) ->
res.render 'login'
post: auth.authenticate
successRedirect: '/admin'
failureRedirect: '/login'
'/logout':
get: (req, res) ->
req.logout()
res.redirect '/login'
'/admin':
get: (req, res) ->
res.send 'admin page!'
'/admin/entries':
get: (req, res) ->
res.send 'admin entries page!'
'/admin/entry/:id':
get: (req, res) ->
res.send 'hello'
post: (req, res) ->
res.send 'hello'
put: (req, res) ->
res.send 'hello'
delete: (req, res) ->
res.send 'hello'
nvm install v0.8.2
npm install -g express
express myapp
cd myapp && npm install
vmc push --runtime=node08
(function() {
var Class = function() {},
slice = Array.prototype.slice,
include;
Class.include = Class.prototype.include = include = function() {
var self = this;
slice.call(arguments).forEach(function(object) {
Object.getOwnPropertyNames(object).forEach(function(name) {
self[name] = object[name];
});
});
};
Class.prototype.hook = function() {};
Class.extend = function(params, scope) {
var parent = this.prototype,
proto = Object.create(parent),
cls = {},
ctor;
include.call(cls, this);
if(arguments.length === 1 && typeof params === 'function') scope = params;
if(typeof scope === 'function') scope.call(proto, parent, cls);
ctor = proto.hasOwnProperty('init') ?
proto.init :
function() { parent.constructor.apply(this, slice.call(arguments)); };
if(typeof params !== 'function') proto.hook(params, parent, cls);
include.call(ctor, cls);
ctor.prototype = proto;
proto.constructor = ctor;
return ctor;
};
if(typeof module !== 'undefined' && module.exports) {
module.exports = Class;
} else {
this.Class = Class;
}
}).call(this);var Box = Class.extend(function(parent, cls) {
// クラス生成時にhookされる
this.hook = function(boxType, parent, cls) { cls.BOXTYPE = boxType; };
});
var FileTypeBox = Box.extend('ftyp', function(parent, cls) {
// body
});
console.log(FileTypeBox.BOXTYPE); // ちゃんと'ftyp'と表示される。bytesToString = function(bytes, bufferSize){
bufferSize = bufferSize || 8192
var buffer = new Uint32Array(bufferSize),
n = bytes.length,
i = 0,
result = '',
j, head;
while(i < n) {
for(j = 0; j < bufferSize && i < n; ++i, ++j) {
head = bytes[i];
if((head >>> 7) === 0) {
buffer[j] = head;
} else if((head >>> 5) === 0x05) {
buffer[j] = ((head & 0x1F) << 6) | (bytes[++i] & 0x3F);
} else if((head >>> 4) === 0x0E) {
buffer[j] =
((head & 0x0F) << 12) |
((bytes[++i] & 0x3F) << 6) |
(bytes[++i] & 0x3F);
} else {
buffer[j] =
((head & 0x07) << 20) |
((bytes[++i] & 0x3F) << 12) |
((bytes[++i] & 0x3F) << 6) |
(bytes[++i] & 0x3F);
}
}
result += String.fromCharCode.apply(void 0, buffer.subarray(0, j));
}
return result;
};
bytesToString2 = function(bytes, bufferSize){
bufferSize = bufferSize || 8192
var buffer = new Uint32Array(bufferSize),
n = bytes.length,
i = 0,
arr = [],
j, head;
while(i < n) {
for(j = 0; j < bufferSize && i < n; ++i, ++j) {
head = bytes[i];
if((head >>> 7) === 0) {
buffer[j] = head;
} else if((head >>> 5) === 0x05) {
buffer[j] = ((head & 0x1F) << 6) | (bytes[++i] & 0x3F);
} else if((head >>> 4) === 0x0E) {
buffer[j] =
((head & 0x0F) << 12) |
((bytes[++i] & 0x3F) << 6) |
(bytes[++i] & 0x3F);
} else {
buffer[j] =
((head & 0x07) << 20) |
((bytes[++i] & 0x3F) << 12) |
((bytes[++i] & 0x3F) << 6) |
(bytes[++i] & 0x3F);
}
}
arr[arr.length] = String.fromCharCode.apply(void 0, buffer.subarray(0, j));
}
return arr.join('');
};
bytesToStringLegacy = function(bytes){
var n = bytes.length,
i = 0,
result = '',
j, head, c;
while(i < n) {
head = bytes[i];
if((head >>> 7) === 0) {
c = head;
} else if((head >>> 5) === 0x05) {
c = ((head & 0x1F) << 6) | (bytes[++i] & 0x3F);
} else if((head >>> 4) === 0x0E) {
c =
((head & 0x0F) << 12) |
((bytes[++i] & 0x3F) << 6) |
(bytes[++i] & 0x3F);
} else {
c =
((head & 0x07) << 20) |
((bytes[++i] & 0x3F) << 12) |
((bytes[++i] & 0x3F) << 6) |
(bytes[++i] & 0x3F);
}
result += String.fromCharCode(c);
++i;
}
return result;
};function unicode2utf8_array(str){
var n = str.length,
idx = -1,
bytes = [],
i, j, c;
for(i = 0; i < n; ++i){
c = str.charCodeAt(i);
if(c <= 0x7F){
bytes[++idx] = c;
} else if(c <= 0x7FF){
bytes[++idx] = 0xC0 | (c >>> 6);
bytes[++idx] = 0x80 | (c & 0x3F);
} else if(c <= 0xFFFF){
bytes[++idx] = 0xE0 | (c >>> 12);
bytes[++idx] = 0x80 | ((c >>> 6) & 0x3F);
bytes[++idx] = 0x80 | (c & 0x3F);
} else {
bytes[++idx] = 0xF0 | (c >>> 18);
bytes[++idx] = 0x80 | ((c >>> 12) & 0x3F);
bytes[++idx] = 0x80 | ((c >>> 6) & 0x3F);
bytes[++idx] = 0x80 | (c & 0x3F);
}
}
return bytes;
}
function unicode2utf8_uint8array(str){
var n = str.length,
idx = -1,
byteLength = 512,
bytes = new Uint8Array(byteLength),
i, c, _bytes;
for(i = 0; i < n; ++i){
c = str.charCodeAt(i);
if(c <= 0x7F){
bytes[++idx] = c;
} else if(c <= 0x7FF){
bytes[++idx] = 0xC0 | (c >>> 6);
bytes[++idx] = 0x80 | (c & 0x3F);
} else if(c <= 0xFFFF){
bytes[++idx] = 0xE0 | (c >>> 12);
bytes[++idx] = 0x80 | ((c >>> 6) & 0x3F);
bytes[++idx] = 0x80 | (c & 0x3F);
} else {
bytes[++idx] = 0xF0 | (c >>> 18);
bytes[++idx] = 0x80 | ((c >>> 12) & 0x3F);
bytes[++idx] = 0x80 | ((c >>> 6) & 0x3F);
bytes[++idx] = 0x80 | (c & 0x3F);
}
if(byteLength - idx <= 4){
_bytes = bytes;
byteLength *= 2;
bytes = new Uint8Array(byteLength);
bytes.set(_bytes);
}
}
return bytes.subarray(0, ++idx);
}
function unicode2utf8_filereader(str, callback) {
var fr = new FileReader();
fr.onloadend = function() {
callback(new Uint8Array(fr.result));
};
fr.readAsArrayBuffer(new Blob([str]));
}function b64decode(str) {
var hash = {'=': 0},
i = 0,
j = 0,
n = str.length,
bytes = new Uint8Array(n * 6 / 8),
a1, a2, a3, a4;
Array.prototype.forEach.call(
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
function(c, i){hash[c] = i});
for(;i < n; i += 4, j += 3) {
a1 = hash[str[i]];
a2 = hash[str[i + 1]];
a3 = hash[str[i + 2]];
a4 = hash[str[i + 3]];
bytes[j] = (a1 << 2) | (a2 >> 4);
bytes[j + 1] = (a2 << 4) | (a3 >> 2);
bytes[j + 2] = (a3 << 6) | a4;
}
return bytes.subarray(0, j - (str[n - 1] === '=' ? 1 : 0) - (str[n - 2] === '=' ? 1 : 0));
}
この広告は90日以上新しい記事の投稿がないブログに表示されております。