The Chrome Extension: Simple Video Download Helper is available on Chrome Webstore. The number of current users exceeds 10000 (Hurrray!)
It is fully open source on Github: https://github.com/DoctorLai/VideoDownloadHelper
New Features
As suggested by my friend, I have added a function allowing users to extract a list of images in the current page.
For example, when users presses the image button, a list of image sources are listed.
Source
$("#pic").click(function() {
let domain = pageurl.replace('http://','').replace('https://','').replace('www.','').split(/[/?#]/)[0];
if (pageurl.startsWith("http://")) {
domain = "http://" + domain;
} else if (pageurl.startsWith("https://")) {
domain = "https://" + domain;
}
$.ajax({
type: "GET",
url: pageurl,
success: function(data) {
var tmp = [];
var re = /]*?src\s*=\s*['\"]([^'\"]*?)['\"][^>]*?>/ig;
var found = re.exec(data);
while (found != null) {
var tmp_url = found[1];
if ((tmp_url != null) && (tmp_url.length > 0)) {
if (tmp_url.startsWith("http://") || tmp_url.startsWith("https://")) {
tmp.push(tmp_url);
} else {
if (tmp_url[0] == '/') {
tmp.push(domain + tmp_url);
} else {
tmp.push(domain + '/' + tmp_url);
}
}
}
found = re.exec(data);
}
if (tmp.length > 0) {
let s;
if (document.getElementById("lang").selectedIndex == 0) {
s = 'Images List
';
} else {
s = '图片列表
';
}
s += ""
;
for (let i = 0; i < tmp.length; ++ i) {
s += "" + tmp[i] + "";
}
s += "";
$('div#down').html(s);
}
},
error: function(request, status, error) {
},
complete: function(data) {
}
});
});
How to Contribute
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request :D
Posted on Utopian.io - Rewarding Open Source Contributors