npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

youtube-quality-generator-deva

v0.0.10

Published

youtube quality generator for capacitor android ionic 4

Downloads

28

Readme

Youtube Quality Extractor

For IONIC 4 (As capacitor plugin)

N|Solid

Ionic 4 Angular 8 Capacitor plugin for generating video quality for android.

By using capacitor, I have created a plugin that will take a youtube link and via capacitor bridge and andorid plugins it will fetch youtube qualities which can be used in your player to play live/recorded videos.

  • ✨Magic ✨

Features

  • Fetch a youtube link and check if it's live or not
  • Send it to the plugin
  • Plugin will return all the urls
  • Use the qualities win your player.
  • Note:By default 360p & 720p will be playable.
  • You will need your own logic to run 480p 1080p qualities because the audio and video files are seperated.
  • No methods for web/iOS. For web i'll suggest you look for ytdl-core (node js)

Tech

I used Angular 8.1.1, Ionic 4, Capacitor 2.4.7 for checking the plugin:

Limitations

Those videos aren't working:

  • Age restricted videos
  • Everything private (private videos, bought movies, ...)
  • Unavailable in your country
  • RTMPE urls (very rare)

Installation

Install the plugin.

npm i youtube-quality-generator-deva
npx cap sync android

Create a service and import the plugin. I have also included a regex to take embed code or short link and convert it to full url by extracting the id. It should look like this =>

import {Injectable} from '@angular/core';
import {Plugins} from '@capacitor/core';
import 'youtube-quality-generator';

const {DevaYoutubeGenerator} = Plugins;

@Injectable()
export class YoutubeExtractService {
    convertedData: any;
    constructor() {
    }

    async getDataFromVideo(video: { link: string, isLive: boolean }) {
        console.log(video);

        const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
        const match = video.link.match(regExp);
        if (match && match[7].length === 11) {
            console.log(match[7]);
            video.link = `http://www.youtube.com/watch?v=${match[7]}`;
        } else {
            alert('Could not extract video ID.');
        }

        try {
            const res = await DevaYoutubeGenerator.getDataFromLink(video);
            console.log('line 27:', res);
            console.log('line 28', JSON.stringify(res));
            console.log('line 29', res['data']);
            window.alert(res['data']);
            this.convertedData = res['data'];
        } catch (e) {
            console.log(e);
        } finally {
            /** your logic for data modelling and sending it to video player***/
        }
    }
}

Plugins

My plugin is currently extended with the following plugins. Instructions on how to use them in your own application are linked below.

| Plugin | README | | ------ | ------ | | Android-Youtube Extractor | link here |

License

MIT

Free Software, Hell Yeah!