Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fake-traffic

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fake-traffic

Internet traffic generator.

  • 3.2
  • PyPI
  • Socket score

Maintainers
1

Python >= 3.9

fake_traffic

Internet traffic generator. Utilizes real-time google search trends by specified parameters.


Install

pip install -U fake_traffic

Install chromium browser with dependencies

playwright install --with-deps chromium

CLI version

fake_traffic -h

CLI examples:

# user located in Austria, who speaks German, using comma separated keywords.
fake_traffic -c at -l de-at -k "Olympiade, Medaille, Beste Leistung"
# user located in Turkey, who speaks Kurdish, using google trends.
fake_traffic -c tr -l ku-tr
# save logs into 'fake_traffic.log'
fake_traffic -c ru -l ru-ru -lf
# use none-headless mode
fake_traffic -c en -l en-us -nh
# limit the number of tabs in the browser to 2
fake_traffic -c en -l en-us -t 2
# add an random delay (30-120 seconds) between requests
fake_traffic -c en -l en-us -t 1 -dmin 30 -dmax 120

Simple usage

from fake_traffic import FakeTraffic

FakeTraffic(country="US", language="en-US").crawl()

Advanced usage

from fake_traffic import FakeTraffic

ft = FakeTraffic(country="US", language="en-US", category="h", headless=True)
    """Internet traffic generator. Utilizes real-time google search trends by specified parameters.
    country (str): Country code ISO 3166-1 Alpha-2 code (https://www.iso.org/obp/ui/), Defaults to "US".
    language (str): Country-language code ISO-639 and ISO-3166 (https://www.fincher.org/Utilities/CountryLanguageList.shtml). Defaults to "en-US".
    keywords (str | None): Comma separated queries for Google searches. If not specified, Google trending is used. Defaults to None.
    headless (bool): Whether to run the browser in headless mode. Defaults to True.
    tabs (int): Limit the number of tabs in browser. Defaults to 3.
    delay_min (float | None): Minimum delay between requests in seconds. Defaults to None.
    delay_max (float | None): Maximum delay between requests in seconds. Defaults to None.
    """

ft.crawl()

Example

Using realtime search trends of a user located in Turkey, who speaks Kurdish

Find Turkey country code (ISO 3166-1 Alpha-2 code):

  • country = "TR"

Find Turkey country-language code (ISO-639 and ISO-3166):

  • english "en-TR",
  • kurdish "ku-TR",
  • turkish "tr-TR".

Starting in none-headless mode:

  • headless=False
from fake_traffic import FakeTraffic

ft = FakeTraffic(country="TR", language="ku-TR", keywords=None, headless=False)
ft.crawl()

P.S. you can select language from other country. For example, such combinations are also correct:

FakeTraffic(country="TR", language="ar-TR").crawl()
FakeTraffic(country="US", language="he-IL").crawl()
FakeTraffic(country="DE", language="hi-IN").crawl()

Other examples

CountryLanguageFunction
FranceFrenchFakeTraffic(country="FR", language="fr-FR")
GermanyGermanFakeTraffic(country="DE", language="de-DE", keywords="Audi")
IndiaEnglishFakeTraffic(country="IN", language="en-IN")
IndiaHindiFakeTraffic(country="IN", language="hi-IN")
RussiaEnglishFakeTraffic(country="RU", language="en-US", headless=False)
RussiaRussianFakeTraffic(country="RU", language="ru-RU")
BrazilPortugueseFakeTraffic(country="BR", language="pt-BR")
United KingdomEnglishFakeTraffic(country="GB", language="en-GB")
United StatesEnglishFakeTraffic(country="US", language="en-US", tabs=4)
United StatesHebrew IsraelFakeTraffic(country="US", language="he-IL")

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc