Merge pull request #842 from jfriviere/archive.org

Add Archive.org so services
This commit is contained in:
Amauri CHAMPEAUX 2021-12-22 11:17:52 +01:00 committed by GitHub
commit e68a3ce855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 18 deletions

View File

@ -5001,34 +5001,48 @@ tarteaucitron.services.mtcaptcha = {
} }
}; };
// Gallica // Internet Archive / https://archive.org
tarteaucitron.services.gallica = { tarteaucitron.services.archive = {
"key": "gallica", "key": "archive",
"type": "other", "type": "video",
"name": "Gallica", "name": "Internet Archive",
"uri": "https://gallica.bnf.fr/edit/und/conditions-dutilisation-des-contenus-de-gallica", "uri": "https://archive.org/about/terms.php",
"needConsent": true, "needConsent": true,
"cookies": ['dtCookie', 'dtLatC', 'dtPC', 'dtSa', 'JSESSIONID', 'rxVisitor', 'rxvt', 'xtvrn'], "cookies": ['abtest-identifier','donation-identifier','PHPSESSID','search-inside-XXX'],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.fallback(['gallica_player'], function (x) { tarteaucitron.fallback(['archive_player'], function (x) {
var src = tarteaucitron.getElemAttr(x, "data-src"), var video_id = tarteaucitron.getElemAttr(x, "data-videoID"),
style = tarteaucitron.getElemAttr(x, "data-style"), video_width = tarteaucitron.getElemAttr(x, "data-width"),
frame; frame_width = 'width=',
if (src === undefined) { video_height = tarteaucitron.getElemAttr(x, "data-height"),
frame_height = 'height=',
video_frame;
if (video_id === undefined) {
return ""; return "";
} }
frame = '<iframe style="'+ style + '" src="' + src + '"></iframe>'; if (video_width !== undefined) {
return frame; frame_width += '"' + video_width + '" ';
} else {
frame_width += '"" ';
}
if (video_height !== undefined) {
frame_height += '"' + video_height + '" ';
} else {
frame_height += '"" ';
}
video_frame = '<iframe src="https://archive.org/embed/' + video_id + '" ' + frame_width + frame_height + ' frameborder="0" webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen></iframe>';
return video_frame;
}); });
}, },
"fallback": function () { "fallback": function () {
"use strict"; "use strict";
var id = 'gallica'; var id = 'archive';
tarteaucitron.fallback(['gallica_player'], function (elem) { tarteaucitron.fallback(['archive_player'], function (elem) {
elem.style = elem.getAttribute('data-style'); elem.style.width = elem.getAttribute('data-width') + 'px';
elem.style.height = elem.getAttribute('data-height') + 'px';
return tarteaucitron.engage(id); return tarteaucitron.engage(id);
}); });
} }
}; };