dappros/ethora

View on GitHub
client-reactnative/src/helpers/getYoutubeMetadata.ts

Summary

Maintainability
A
0 mins
Test Coverage
import axios from 'axios';

export const getYoutubeMetadata = async (url: string) => {
  const metaUrl = `https://www.youtube.com/oembed?url=${url}&format=json`;
  const config = {
    method: 'get',
    url: metaUrl,
    headers: {},
  };
  return await axios(config).catch(err => console.log(JSON.stringify(err)));
};