Random User Agent generator

This commit is contained in:
Pablo Ferreiro 2023-03-05 13:18:34 +01:00
parent ecba96eaf4
commit eeaa8cdf1c
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
2 changed files with 71 additions and 25 deletions

View file

@ -164,7 +164,11 @@ class Wrappers {
} }
} }
$options["user_agent"] = Misc::env("USER_AGENT", TikScraperUserAgents::DEFAULT); $customUa = Misc::env("USER_AGENT", '');
if ($customUa) {
$options['user_agent'] = $customUa;
}
return new \TikScraper\Api($options, $cacheEngine); return new \TikScraper\Api($options, $cacheEngine);
} }

90
composer.lock generated
View file

@ -57,6 +57,46 @@
}, },
"time": "2021-11-18T19:24:07+00:00" "time": "2021-11-18T19:24:07+00:00"
}, },
{
"name": "deemon47/user-agent-generator",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/Deemon47/user-agent-generator.git",
"reference": "5af13fd2e905c5441eb4d61aad3a71bd1e801709"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Deemon47/user-agent-generator/zipball/5af13fd2e905c5441eb4d61aad3a71bd1e801709",
"reference": "5af13fd2e905c5441eb4d61aad3a71bd1e801709",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-4": {
"Deemon47\\": "./"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-3.0-only"
],
"authors": [
{
"name": "phpfail",
"email": "phpfail@gihub.com"
},
{
"name": "Dee",
"email": "deemon47@gmail.com"
}
],
"description": "Generate random User-Agent http header with parameters",
"support": {
"source": "https://github.com/Deemon47/user-agent-generator/tree/v1.0.1"
},
"time": "2020-04-11T12:05:34+00:00"
},
{ {
"name": "josegonzalez/dotenv", "name": "josegonzalez/dotenv",
"version": "dev-master", "version": "dev-master",
@ -263,19 +303,20 @@
}, },
{ {
"name": "pablouser1/tikscraper", "name": "pablouser1/tikscraper",
"version": "v2.3.4.1", "version": "v2.3.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pablouser1/TikScraperPHP.git", "url": "https://github.com/pablouser1/TikScraperPHP.git",
"reference": "4426ee91c13b4661fd11e1d3f4b5da33c64fbc75" "reference": "825b486fa07832a4ee694739ca4ffdb67c392fb8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/4426ee91c13b4661fd11e1d3f4b5da33c64fbc75", "url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/825b486fa07832a4ee694739ca4ffdb67c392fb8",
"reference": "4426ee91c13b4661fd11e1d3f4b5da33c64fbc75", "reference": "825b486fa07832a4ee694739ca4ffdb67c392fb8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"deemon47/user-agent-generator": "^1.0",
"ext-curl": "*", "ext-curl": "*",
"ext-json": "*", "ext-json": "*",
"ext-xml": "*", "ext-xml": "*",
@ -305,43 +346,44 @@
"description": "Get data from TikTok API", "description": "Get data from TikTok API",
"support": { "support": {
"issues": "https://github.com/pablouser1/TikScraperPHP/issues", "issues": "https://github.com/pablouser1/TikScraperPHP/issues",
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.4.1" "source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.5.0"
}, },
"time": "2023-01-28T16:31:29+00:00" "time": "2023-03-05T12:17:33+00:00"
}, },
{ {
"name": "php-webdriver/webdriver", "name": "php-webdriver/webdriver",
"version": "1.13.1", "version": "1.14.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-webdriver/php-webdriver.git", "url": "https://github.com/php-webdriver/php-webdriver.git",
"reference": "6dfe5f814b796c1b5748850aa19f781b9274c36c" "reference": "3ea4f924afb43056bf9c630509e657d951608563"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/6dfe5f814b796c1b5748850aa19f781b9274c36c", "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/3ea4f924afb43056bf9c630509e657d951608563",
"reference": "6dfe5f814b796c1b5748850aa19f781b9274c36c", "reference": "3ea4f924afb43056bf9c630509e657d951608563",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-curl": "*", "ext-curl": "*",
"ext-json": "*", "ext-json": "*",
"ext-zip": "*", "ext-zip": "*",
"php": "^5.6 || ~7.0 || ^8.0", "php": "^7.3 || ^8.0",
"symfony/polyfill-mbstring": "^1.12", "symfony/polyfill-mbstring": "^1.12",
"symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0 || ^6.0" "symfony/process": "^5.0 || ^6.0"
}, },
"replace": { "replace": {
"facebook/webdriver": "*" "facebook/webdriver": "*"
}, },
"require-dev": { "require-dev": {
"ondram/ci-detector": "^2.1 || ^3.5 || ^4.0", "ergebnis/composer-normalize": "^2.20.0",
"ondram/ci-detector": "^4.0",
"php-coveralls/php-coveralls": "^2.4", "php-coveralls/php-coveralls": "^2.4",
"php-mock/php-mock-phpunit": "^1.1 || ^2.0", "php-mock/php-mock-phpunit": "^2.0",
"php-parallel-lint/php-parallel-lint": "^1.2", "php-parallel-lint/php-parallel-lint": "^1.2",
"phpunit/phpunit": "^5.7 || ^7 || ^8 || ^9", "phpunit/phpunit": "^9.3",
"squizlabs/php_codesniffer": "^3.5", "squizlabs/php_codesniffer": "^3.5",
"symfony/var-dumper": "^3.3 || ^4.0 || ^5.0 || ^6.0" "symfony/var-dumper": "^5.0 || ^6.0"
}, },
"suggest": { "suggest": {
"ext-SimpleXML": "For Firefox profile creation" "ext-SimpleXML": "For Firefox profile creation"
@ -370,9 +412,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-webdriver/php-webdriver/issues", "issues": "https://github.com/php-webdriver/php-webdriver/issues",
"source": "https://github.com/php-webdriver/php-webdriver/tree/1.13.1" "source": "https://github.com/php-webdriver/php-webdriver/tree/1.14.0"
}, },
"time": "2022-10-11T11:49:44+00:00" "time": "2023-02-09T12:12:19+00:00"
}, },
{ {
"name": "sapistudio/seleniumstealth", "name": "sapistudio/seleniumstealth",
@ -572,16 +614,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v5.4.19", "version": "v5.4.21",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1" "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/c5ba874c9b636dbccf761e22ce750e88ec3f55e1", "url": "https://api.github.com/repos/symfony/process/zipball/d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd",
"reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1", "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -614,7 +656,7 @@
"description": "Executes commands in sub-processes", "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/process/tree/v5.4.19" "source": "https://github.com/symfony/process/tree/v5.4.21"
}, },
"funding": [ "funding": [
{ {
@ -630,7 +672,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-01-01T08:32:19+00:00" "time": "2023-02-21T19:46:44+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],