
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@onepunya/yt-converter-js
Advanced tools
# @onepunya/yt-converter-js
A simple Node.js class to interact with YouTube video search and conversion services.
## Installation
To use this package, you need to have Node.js installed. You can install this package via npm:
```bash
npm install @onepunya/yt-converter-js
import Youtube from '@onepunya/yt-converter-js';
or
const Youtube = require('@onepunya/yt-converter-js');
const youtube = new Youtube();
Use the search
method to search for videos based on a query.
const query = 'Kokoronashi';
youtube.search(query)
.then(result => {
console.log(result);
})
.catch(error => {
console.error('Error:', error);
});
Parameters:
query
(string): The search query string.Returns: A promise that resolves to an object with the following structure:
{
"status": "ok",
"message": "",
"query": "faded",
"items": [
{
"videoId": "60ItHLz5WEA",
"title": "Alan Walker - Faded",
"youtubeUrl": "https://youtu.be/60ItHLz5WEA"
},
{
"videoId": "jlKOSk-tXFQ",
"title": "Alan Walker - Fade (Official Music Video)",
"youtubeUrl": "https://youtu.be/jlKOSk-tXFQ"
}
],
"platform": "YouTube"
}
Use the download
method to convert a YouTube video to MP3 or MP4.
const videoUrl = 'https://www.youtube.com/watch?v=video_id';
youtube.download(videoUrl)
.then(result => {
console.log(result);
})
.catch(error => {
console.error('Error:', error);
});
Parameters:
videoUrl
(string): The URL of the YouTube video.Returns: A promise that resolves to an object with the following structure:
{
"title": "video_title",
"thumbnail": [],
//thumbnail format
//preview: 'https://i.ytimg.com/vi/9O_1dxvEduM/hqdefault.jpg',
// resolution: 'High (480x360)'
"mp4DownloadLink": "link_to_mp4_file",
"mp3DownloadLink": "link_to_mp3_file"
}
Both methods return promises that will be rejected if an error occurs. Handle errors using .catch
in your promise chain.
This project is licensed under the MIT License.
FAQs
```markdown # @onepunya/yt-converter-js
The npm package @onepunya/yt-converter-js receives a total of 3 weekly downloads. As such, @onepunya/yt-converter-js popularity was classified as not popular.
We found that @onepunya/yt-converter-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.