Git Product home page Git Product logo

Comments (10)

efraespada avatar efraespada commented on June 9, 2024 1

Sorry, you are right πŸ˜„

Now working as expected πŸš€

from flightradar24-client.

tux2000 avatar tux2000 commented on June 9, 2024

as of right now its still working for me... with [email protected]

from flightradar24-client.

efraespada avatar efraespada commented on June 9, 2024

Not for me with a simple local test.

Error: Forbidden
statusCode: 403

The problem is the current UserAgent:

const headers = {
	//'User-Agent': 'https://github.com/derhuerst/fetch-flightradar24-flights'
}

It could be banned.

I've replaced that piece of code with:

const headers = {
	'User-Agent': makeId(5)
}

function makeId(length) {
	let result = '';
	const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
	const charactersLength = characters.length;
	let counter = 0;
	while (counter < length) {
		result += characters.charAt(Math.floor(Math.random() * charactersLength));
		counter += 1;
	}
	return result;
}

from flightradar24-client.

tux2000 avatar tux2000 commented on June 9, 2024

@efraespada, did you test with version 1.0.0? The user agent should be fixed already using the code here: https://github.com/derhuerst/flightradar24-client/blob/abc2a54a747cb1153ec97fe5df91541bd163ea0d/lib/random-user-agent.js (see also #29 )

from flightradar24-client.

UnclePhil avatar UnclePhil commented on June 9, 2024

from flightradar24-client.

UnclePhil avatar UnclePhil commented on June 9, 2024

My version is correct, and i have the problem

the package.json in the node_modules

{
	"name": "flightradar24-client",
	"description": "Fetch aircraft data from Flightradar24.",
	"version": "1.0.0",
	"type": "module",
	"main": "index.js",
	"files": [
		"index.js",
		"lib"
	],
	"keywords": [
		"aviation",
		"airplanes",
		"flights",
		"flightradar24"
	],
	"author": "Jannis R <[email protected]>",
	"contributors": [
		"@E3V3A"
	],
	"homepage": "https://github.com/derhuerst/flightradar24-client",
	"repository": "derhuerst/flightradar24-client",
	"bugs": "https://github.com/derhuerst/flightradar24-client/issues",
	"license": "ISC",
	"engines": {
		"node": ">=18"
	},
	"dependencies": {
		"fetch-ponyfill": "^7.1.0",
		"moment-timezone": "^0.5.13",
		"parse-jsonp": "^2.0.0"
	},
	"devDependencies": {
		"eslint": "^8.44.0",
		"tap-min": "^2.0.0",
		"tape": "^5.6.4"
	},
	"scripts": {
		"lint": "eslint .",
		"test": "node test.js | tap-min",
		"prepublishOnly": "npm run lint && npm test"
	}
}

from flightradar24-client.

tux2000 avatar tux2000 commented on June 9, 2024

Probably this is obvious for everyone else, but when trying to understand what was wrong on my system, I figured out that the flightradar24-client module was installed not only in the top level node_modules folder but as an older version in the node_modules/node-red-contrib-fr24tube/node_modules folder. I know your the author of fr24tube, so its unlikely that this would get in your way, but still letting you know, just in case...

from flightradar24-client.

UnclePhil avatar UnclePhil commented on June 9, 2024

from flightradar24-client.

derhuerst avatar derhuerst commented on June 9, 2024

Just to prevent false positives here, can you all make sure you're running the latest 0.x version (0.3.1) or 1.x (currently 1.0.0)? You can check this using npm ls (or npm ls --depth 2, if flightradar24-client is nested within another package's dependencies).

In addition, it might be that you're being IP-rate-limited or -blocked. To rule this out, you can try to debug this from a fresh IP (that you haven't made requests from).

from flightradar24-client.

derhuerst avatar derhuerst commented on June 9, 2024

Closing this. Please try to provide steps to reproduce the issue when it occurs again.

from flightradar24-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.