Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@media-info/csfd-api
Advanced tools
Readme
A simple UMD package to fetch data about movies and shows recursively from ČSFD for both the browser and Node.js.
$ npm install @media-info/csfd-api
import CSFD from '@media-info/csfd-api';
const csfd = new CSFD('cs');
const csfdItem = await csfd.fetch(1);
console.log(data);
You can fetch data by using CSFD API wrapper or by accessing CSFDItem class object directly.
locale
(string
, values: cs
en
): translates genres and countries to set languageconfig
(object
, optional
, default {}
): allows you to
configure axios which is internally used to fetch data. You can
also set proxyUrl
to avoid CORS issues using a server as proxy. It appends URL path after provided value.Creates CSFD class object using provided config
const csfd = new CSFD('cs', {
http: {
headers: {'X-Requested-With': 'XMLHttpRequest'}
},
// example internal call: https://example.proxy/csfd/film/69266-tom-a-jerry/prehled/
proxyUrl: 'https://example.proxy/csfd',
chunkSize: 10,
});
Get CSFDItem class object using an ID.
const csfdItem = csfd.get(1);
await csfdItem.fetch();
Get CSFD data object directly using an ID.
const csfdData = await csfd.fetch(1);
Get CSFDSearchItem class object using a ČSFD search.
const csfdSearchItem = await csfd.search('apolo');
const csfdItems = await csfdSearchItem.fetchAll();
Fetches all available data for every search result item and returns them as an object
Fetches all available data and returns them as an object
children
(boolean
, optional
, default true
): children are fetched concurrently in chunks to increase speed
dramatically. Default chunk size is 10.
NOTE: It takes a lot of time when fetching big tv show - each item requires 2 HTTP requests.
Example
csfdItem.fetch(false).then(response => {});
Response
{
"ids": {
"csfd": 2294
},
"children_ids": [],
"main_title": "Vykoupení z věznice Shawshank",
"titles": [
{
"language": "en",
"title": "The Shawshank Redemption",
"country": "US"
},
{
"language": "sk",
"title": "Vykúpenie z väznice Shawshank",
"country": "SK"
},
{
"language": "en",
"title": "The Shawshank Redemption",
"country": "NZ"
}
],
"year": 1994,
"duration": 8520,
"mediaType": "film",
"poster": "//image.pmgstatic.com/files/images/film/posters/162/505/162505167_735db9.jpg",
"plot": "Mladý bankovní manažer Andy Dufresne (Tim R...",
"rating": 9.5,
"votes": 107035,
"origin": [
"US"
],
"premieres": {
"CZ": {
"cinema": "1995-07-06T00:00:00.000Z",
"dvd": "2003-03-31T00:00:00.000Z",
"blu-ray": "2016-11-30T00:00:00.000Z"
},
"US": {
"cinema": "1994-10-14T00:00:00.000Z"
}
},
"genre": [
"Drama",
"Crime"
],
"director": [
"Frank Darabont"
],
"writer": [
"Frank Darabont"
],
"cast": [
"Tim Robbins",
"Morgan Freeman"
],
"author": [],
"music": [
"Thomas Newman"
],
"camera": [
"Roger Deakins"
],
"trailers": [
{
"name": "Trailer 1",
"language": "en",
"src": "//video.pmgstatic.com/files/videos/008/486/8486616/157727807_28ae07.mp4",
"quality": 360,
"subtitles": [
{
"src": "//video.pmgstatic.com/files/subtitles/008/500/8500445_08847d.vtt",
"language": "cs"
}
]
}
],
"children": []
}
You can access each property separately.
NOTE: you have to load children data before you can access their properties
Example:
csfdItem.cast.join(', ');
console.log(csfdItem.areChildrenLoaded) // false
csfdItem.children.find(child => child.season === 1); // undefined
await csfdItem.fetchChildren();
console.log(csfdItem.areChildrenLoaded) // true
csfdItem.children.find(child => child.season === 1); // CSFDItem
FAQs
A simple UMD package to fetch data about movies and shows recursively from ČSFD for both the browser and Node.js.
The npm package @media-info/csfd-api receives a total of 0 weekly downloads. As such, @media-info/csfd-api popularity was classified as not popular.
We found that @media-info/csfd-api demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.