Skip to content

A Javascript library to create *.metalink or *.meta4 files from JSON

License

Notifications You must be signed in to change notification settings

jc3213/metalink.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Usage

Download

Latest

HTML

<script src="https://jc3213.github.io/metalink.js/metalink.js"></script>

TamperMonkey

// @require https://jc3213.github.io/metalink.js/metalink.js

Syntax

let file1 = {url: {url: 'https://jc3213.github.io/metalink.js/metalink.js', location: 'en'}, version: '0.1.0'};
let file2 = {url: 'https://github.com/jc3213/metalink.js/archive/refs/heads/main.zip', name: '[email protected]'}
let metalink = new Metalink(file1, file2);

file

url required

  • The download url(s) of the file
  • string
  • object: {url, location}
    • url: required
    • location: optional
  • array: [string1, string2, string3, ...]
  • array: [object1, object2, object3, ...]

name optional

  • The name of the file
  • string

size optional

  • The size of the file
  • integer

version optional

  • The version of the file
  • string

language optional

  • The language of the file
  • string

hash optional

  • The hash(es) of the file
  • object: {type, hash}
    • type: required
    • hash: required
  • array: [object1, object2, object3, ...]

metaurl optional

  • The metalink(s) of the file
  • object: {type, url}
    • type: required
    • url: required
  • array: [object1, object2, object3, ...]

Method

save

metalink.save(filename);
  • filename
    • String
    • The file name you'd like to save
    • Default metalink_yymmdd_hhmmss

About

A Javascript library to create *.metalink or *.meta4 files from JSON

Topics

Resources

License

Stars

Watchers

Forks