【MV】Lucky☆Orb feat. Hatsune Miku by emon(Tes.) / 럭키☆오브 feat. 하츠네 미쿠 by emon(Tes.) 【MIKU EXPO 5th】
 _ ラッキー☆オーブ feat. 初音ミク by emon(Tes.) 【MIKU EXPO 5th】 - YouTube_files/unnamed.jpg)
diff --git a/LICENSE b/LICENSE index c5e0a94..0795268 100755 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 SiruBOT +Copyright (c) 2022 Sannoob3144 (cocochino.cafe) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index ebb26fd..c97bbe0 100755 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "crawler" ], "author": "Sannoob#3144", - "license": "WTFPL", + "license": "MIT", "bugs": { "url": "https://github.com/SiruBOT/youtube-related-scraper/issues" }, diff --git a/tests/Client.test.js b/tests/Client.test.js deleted file mode 100755 index 4fa11d5..0000000 --- a/tests/Client.test.js +++ /dev/null @@ -1,42 +0,0 @@ -const Client = require('../src/Client') -const { expectVideoObject } = require('./Parser.test') -const URLS = { - ytURL: 'https://www.youtube.com/watch?v=AufydOsiD6M', - ytID: 'AufydOsiD6M', - notYTID: 'asdfasdf', - notYTURL: 'https://google.com' -} - -// Client -describe('Client', () => { - it('URL is valid youtube url', (done) => { - Client.get(URLS.ytURL) - .then((result) => { - expectVideoObject(result) - done() - }) - .catch((e) => done(e)) - }) - it('URL is valid youtube id', (done) => { - Client.get(URLS.ytID) - .then((result) => { - expectVideoObject(result) - done() - }) - .catch((e) => done(e)) - }) - it('URL is not valid youtube url', (done) => { - Client.get(URLS.notYTURL) - .then(() => { - done(new Error('It should throws error')) - }) - .catch(() => done()) - }) - it('URL is not valid youtube id', (done) => { - Client.get(URLS.notYTID) - .then(() => { - done(new Error('It should throws error')) - }) - .catch(() => done()) - }) -}) diff --git a/tests/Parser.test.js b/tests/Parser.test.js deleted file mode 100755 index e200683..0000000 --- a/tests/Parser.test.js +++ /dev/null @@ -1,34 +0,0 @@ -const Parser = require('../src/Parser') -const fs = require('fs') -const path = require('path') -const chai = require('chai') -const expect = chai.expect - -describe('Parser', () => { - it('Parse valid html', (done) => { - const parsed = Parser.parse(fs.readFileSync(path.join(__dirname, './youtube-html.html')).toString()) - expectVideoObject(parsed) - done() - }) - - it('Parse not valid youtube html', (done) => { - try { - Parser.parse(fs.readFileSync(path.join(__dirname, './wrong-html.html')).toString()) - done(new Error('It expect throws error')) - } catch { - done() - } - }) -}) - -function expectVideoObject (result) { - expect(result).to.be.an('array').that.is.not.empty - result.map(el => { - expect(el).to.have.a.property('videoId') - expect(el).to.have.a.property('title') - expect(el).to.have.a.property('duration') - expect(el).to.have.a.property('uri') - }) -} - -module.exports.expectVideoObject = expectVideoObject diff --git a/tests/RoutePlanner.test.js b/tests/RoutePlanner.test.js deleted file mode 100755 index e094ab5..0000000 --- a/tests/RoutePlanner.test.js +++ /dev/null @@ -1,43 +0,0 @@ -const Client = require('../src/Client') -const RoutePlanner = require('../src/RoutePlanner') -const { expectVideoObject } = require('./Parser.test') -const URLS = { - ytURL: 'https://www.youtube.com/watch?v=AufydOsiD6M' -} -describe('RoutePlanner', () => { - let planner - describe('Type Check', () => { - it('IPBlocks not valid ip cidr', (done) => { - try { - planner = new RoutePlanner(['hello this is not valid'], [], 1) - done(new Error('Instance not throw "Invalid CIDR subnet"')) - } catch (e) { - if (e.message.includes('invalid CIDR subnet')) return done() - done(e) - } - }) - }) - describe('Get Random Cidr', () => { - it('IPv6', (done) => { - planner = new RoutePlanner(['2001:470:fd9a::/128'], [], 1) - planner.getRandom() - done() - }) - it('IPv4', (done) => { - planner = new RoutePlanner(['192.168.0.1/32'], [], 1) - planner.getRandom() - done() - }) - }) - describe('Using RoutePlanner With Client', () => { - const ip = require('ip') - it(`CIDR Range: ${ip.address('public')}/32`, (done) => { - planner = new RoutePlanner([ip.address('public') + '/32'], [], 1) - Client.get(URLS.ytURL, planner) - .then(res => { - expectVideoObject(res) - done() - }).catch(done) - }) - }) -}) diff --git a/tests/wrong-html.html b/tests/wrong-html.html deleted file mode 100755 index 9148dcf..0000000 --- a/tests/wrong-html.html +++ /dev/null @@ -1,367 +0,0 @@ - - -