Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const axios = require('axios');
- function YoutubeVideo(QUERY) {
- return new Promise((resolve, reject) => {
- axios
- .get('https://arugaz.my.id/api/media/ytvideo?url=' + encodeURIComponent(QUERY))
- .then(req => {
- resolve(req.data)
- })
- .catch(reject)
- })
- }
- YoutubeVideo('https://youtu.be/6l5V3BWDcMw')
- .then(res => console.log(res))
- .catch(err => console.log(err))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement