Comments (8)
Package: 0.2.6
I assume you mean 2.0.6. Update the package to 2.0.9 and see if the problem persists, there have been several updates that could be related
Not a typo! Didn't realise is was so out of date. Will update app to latest version and report back.
from scrape-youtube.
Code here:
const express = require("express");
const { default: youtube } = require("scrape-youtube");
const cache = require("../helpers/cache");
const Router = express.Router();
Router.get("/search", async (req, res) => {
try {
let { q, cached } = req.query;
const allowCached = cached !== "false";
if (!q) return res.send({ error: "Invalid query!" });
q = q.trim();
if (allowCached) {
const cachedResults = await cache.getResults(q);
if (cachedResults && cachedResults.length !== 0) {
return res.send({ results: cachedResults, cached: true });
}
}
let freshResults = await youtube.search(
q,
{ safeSearch: true },
{ safeSearch: true, headers: { Cookie: "PREF=f2=8000000" } }
);
freshResults = freshResults.videos.map((video) => ({
id: video.id,
title: video.title,
}));
res.send({ results: freshResults, length: freshResults.length });
if (freshResults.length > 0) await cache.saveResults(q, freshResults);
} catch (error) {
console.error(error);
res.send({ error: "Backend error." });
}
});
module.exports = Router;
from scrape-youtube.
Package: 0.2.6
I assume you mean 2.0.6. Update the package to 2.0.9 and see if the problem persists, there have been several updates that could be related
from scrape-youtube.
updated to latest v2.0.9. Problem still persists unfortunately.
For reference, most other searches are working fine:
'duggee' never works, 'lego' is intermittent
from scrape-youtube.
Alright thanks for reporting. I ran a few tests on a server I have in London and wasn't able to reproduce the issue you're having.
I'll need to dig around more during the weekend. If you could provide a sample of the code (showing how you're using the package, filtering the results ect) that would be helpful.
from scrape-youtube.
from scrape-youtube.
Hi, this is happening again on 2.0.9:
from scrape-youtube.
cats / lego and both intermittent too
from scrape-youtube.
Related Issues (20)
- Convert subscriber count to number
- Allow scrapping trending videos HOT 1
- Search Pagination HOT 1
- Search Filter - Is it possible to search for YouTube videos that has subtitles/CC ? HOT 2
- the link string on response objects conflicts with the String.link() function HOT 4
- youtube.search is not a function HOT 2
- search is not a function HOT 5
- TypeError when using exported search function HOT 2
- Explicit Content Filter HOT 6
- Filter videos by hashtag HOT 3
- Video descriptions are always blank
- TypeError: Cannot read property 'simpleText' of undefined HOT 4
- Feature: Test runner
- TypeError: The "listener" argument must be of type Function. Received type object HOT 9
- Country filter HOT 1
- Can I search by channel? HOT 1
- [Feature request] Support for new channel handles HOT 9
- Invalid subscriber count / video count HOT 1
- Video count unavailable for channels
- How to pass maxResult with TS? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrape-youtube.