Skip to content

Commit

Permalink
Improve metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
GuGuss committed Oct 15, 2015
1 parent 9ac84ca commit 6abde91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arte-downloader.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ function createButtonMetadata(element) {
var metadata = getMetadata(response);
// Properly encode to Base 64.
var encodedData = window.btoa(unescape(encodeURIComponent(metadata)));
// The href will output a text file.
// For a CSV file, that would be: data:application/octet-stream,field1%2Cfield2%0Afoo%2Cbar%0Agoo%2Cgai%0A
button.setAttribute('href', 'data:application/octet-stream;charset=utf-8;base64,' + encodedData);
}
});
Expand Down Expand Up @@ -124,7 +126,7 @@ function getVideoName (response, quality) {
function getMetadata (response) {
var json = JSON.parse(response.responseText);
console.log(json['video']);
var metadata = json['video']['VDE'] + json['video']['VTA'] + json['video']['V7T'];
var metadata = json['video']['V7T'] + '\n\n' + json['video']['VDE'] + '\n\n' + json['video']['VTA'];
return metadata;
}

Expand Down

0 comments on commit 6abde91

Please sign in to comment.