Simple crate to login to Pinterest and get the cookies via Chromiumoxide to simulate a browser

Overview

pinterest-login

Simple crate to login to Pinterest and get the cookies via Chromiumoxide to simulate a browser (open a real browser actually), to use the Pinterest API without needing a developer account or an API key or anything that costs money :).

crates.io docs.rs downloads license

Asynchronous, and uses async-std as the runtime by default (you can use tokio if you want)

WARNING: This project isn't officially supported by Pinterest, and it's not affiliated with Pinterest in any way.

Examples

With the async-std runtime

{ // Store the cookies in a file or something, and do whatever you want with them // I like the cookies bay the way // ... println!("{}", cookies.len()); println!("{:?}", cookies); } Err(e) => { // The login was unsuccessful eprintln!("The login was unsuccessful: {}", e); } }; }">
use pinterest_login::config_builder::DefaultBrowserConfigBuilder;
use pinterest_login::login;
use pinterest_login::login_bot::DefaultBrowserLoginBot;

#[async_std::main]
async fn main() {
    let email = std::env::var("PINTEREST_EMAIL").unwrap();
    let password = std::env::var("PINTEREST_PASSWORD").unwrap();

    let bot = DefaultBrowserLoginBot::new(email.as_str(), password.as_str());
    let config_builder = DefaultBrowserConfigBuilder::default();

    match login(&bot, &config_builder).await {
        Ok(cookies) => {
            // Store the cookies in a file or something, and do whatever you want with them
            // I like the cookies bay the way
            // ...
            println!("{}", cookies.len());
            println!("{:?}", cookies);
        }
        Err(e) => {
            // The login was unsuccessful
            eprintln!("The login was unsuccessful: {}", e);
        }
    };
}
{ // ... } Err(e) => { // The login was unsuccessful eprintln!("The login was unsuccessful: {}", e); } }; }">
use pinterest_login::config_builder::DefaultBrowserConfigBuilder;
use pinterest_login::login;
use pinterest_login::login_bot::DefaultBrowserLoginBot;
use std::time::Duration;

#[async_std::main]
async fn main() {
    let email = std::env::var("PINTEREST_EMAIL").unwrap();
    let password = std::env::var("PINTEREST_PASSWORD").unwrap();

    let bot = DefaultBrowserLoginBot::new(email.as_str(), password.as_str());

   // Show the browser, and set the request timeout to 2 seconds
    let config_builder = DefaultBrowserConfigBuilder::new(false, Duration::from_secs(2).into(), None);

    match login(&bot, &config_builder).await {
        Ok(cookies) => {
            // ...
        }
        Err(e) => {
            // The login was unsuccessful
            eprintln!("The login was unsuccessful: {}", e);
        }
    };
}

With tokio runtime

{ // ... } Err(e) => { // The login was unsuccessful eprintln!("The login was unsuccessful: {}", e); } }; }">
use pinterest_login::config_builder::DefaultBrowserConfigBuilder;
use pinterest_login::login;
use pinterest_login::login_bot::DefaultBrowserLoginBot;
use std::time::Duration;

#[tokio::main]
async fn main() {
    let email = std::env::var("PINTEREST_EMAIL").unwrap();
    let password = std::env::var("PINTEREST_PASSWORD").unwrap();

   let bot = DefaultBrowserLoginBot::new(email.as_str(), password.as_str());

  // Show the browser, and set the request timeout to 2 seconds
   let config_builder = DefaultBrowserConfigBuilder::new(false, Duration::from_secs(2).into(), None);

    match login(&bot, &config_builder).await {
        Ok(cookies) => {
            // ...
        }
        Err(e) => {
            // The login was unsuccessful
            eprintln!("The login was unsuccessful: {}", e);
        }
    };
}

Features

  • async-std-runtime: Use the async-std runtime instead of tokio (enabled by default)
  • tokio-runtime: Use the tokio runtime instead of async-std
  • debug: Enable debug logging

Contributing

I'm happy to accept any contributions, just consider reading the CONTRIBUTING.md guide first. to avoid waste waste our time on some unnecessary things.

the main keywords are: signed commits, conventional commits, no emojis, linear history, the PR shouldn't have more than tree commits most of the time

License

This project is licensed under ether the MIT license or the Unlicense license, you can choose which one you want.

This project is part of the pinterest-rs project

License: MIT OR Unlicense

Comments
  • fix(deps): update rust crate async-trait to 0.1.74

    fix(deps): update rust crate async-trait to 0.1.74

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | async-trait | dependencies | patch | 0.1.73 -> 0.1.74 |


    Release Notes

    dtolnay/async-trait (async-trait)

    v0.1.74

    Compare Source

    • Documentation improvements

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    size/XS 
    opened by renovate[bot] 0
  • fix(deps): update rust crate tokio to 1.33.0

    fix(deps): update rust crate tokio to 1.33.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | tokio (source) | dependencies | minor | 1.32.0 -> 1.33.0 |


    Release Notes

    tokio-rs/tokio (tokio)

    v1.33.0: Tokio v1.33.0

    Compare Source

    1.33.0 (October 9, 2023)

    Fixed
    • io: mark Interest::add with #[must_use] (#​6037)
    • runtime: fix cache line size for RISC-V (#​5994)
    • sync: prevent lock poisoning in watch::Receiver::wait_for (#​6021)
    • task: fix spawn_local source location (#​5984)
    Changed
    • macros: use ::core imports instead of ::std in tokio::test (#​5973)
    • sync: use Acquire/Release orderings instead of SeqCst in watch (#​6018)
    Added
    Removed
    Documented
    Unstable

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    size/XS 
    opened by renovate[bot] 0
  • chore(deps): bump chromiumoxide from 0.5.3 to 0.5.4

    chore(deps): bump chromiumoxide from 0.5.3 to 0.5.4

    Bumps chromiumoxide from 0.5.3 to 0.5.4.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    size/XS dependencies rust 
    opened by dependabot[bot] 0
  • fix(deps): update rust crate chromiumoxide to 0.5.4 - autoclosed

    fix(deps): update rust crate chromiumoxide to 0.5.4 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | chromiumoxide | dependencies | patch | 0.5.3 -> 0.5.4 |


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    size/XS 
    opened by renovate[bot] 0
  • fix(deps): update rust crate chromiumoxide to 0.5.3

    fix(deps): update rust crate chromiumoxide to 0.5.3

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | chromiumoxide | dependencies | patch | 0.5.1 -> 0.5.3 |


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    size/XS 
    opened by renovate[bot] 0
  • chore(deps): bump thiserror from 1.0.48 to 1.0.49

    chore(deps): bump thiserror from 1.0.48 to 1.0.49

    Bumps thiserror from 1.0.48 to 1.0.49.

    Release notes

    Sourced from thiserror's releases.

    1.0.49

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    size/XS dependencies rust 
    opened by dependabot[bot] 0
  • fix(deps): update rust crate thiserror to 1.0.49 - autoclosed

    fix(deps): update rust crate thiserror to 1.0.49 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | thiserror | dependencies | patch | 1.0.48 -> 1.0.49 |


    Release Notes

    dtolnay/thiserror (thiserror)

    v1.0.49

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    size/XS 
    opened by renovate[bot] 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • Cargo.toml (cargo)
    • .github/workflows/ci.yml (github-actions)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Show all Merge Confidence badges for pull requests.
    • Enable Renovate Dependency Dashboard creation.
    • Use semantic commit type fix for dependencies and chore for all others if semantic commits are in use.
    • Ignore node_modules, bower_components, vendor and various test/tests directories.
    • Group known monorepo packages together.
    • Use curated list of recommended non-monorepo package groupings.
    • Apply crowd-sourced package replacement rules.
    • Apply crowd-sourced workarounds for known problems with packages.

    πŸ”‘ Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    size/XS 
    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    This repository currently has no open or pending branches.

    Detected dependencies

    cargo
    Cargo.toml
    • futures 0.3.28
    • thiserror 1.0.49
    • async-trait 0.1.74
    • chromiumoxide 0.5.4
    • async-std 1.12.0
    • tokio 1.33.0
    • log 0.4.20
    github-actions
    .github/workflows/ci.yml
    • actions/checkout v4
    • actions-rs/toolchain v1
    • actions-rs/cargo v1
    • actions/checkout v4
    • actions-rs/toolchain v1
    • Swatinem/rust-cache v2
    • actions/checkout v4
    • actions/checkout v4
    • actions-rs/toolchain v1
    • Swatinem/rust-cache v2
    • actions-rs/cargo v1
    • actions-rs/cargo v1
    • EmbarkStudios/cargo-deny-action v1
    • actions-rs/audit-check v1
    • lycheeverse/lychee-action v1

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Releases(0.1.1)
Owner
Anas
0E4F 7AB7 210F A285 6F1A AD7E 3844 2349 DD00 D8C6
Anas
Command line login for SRun Auth Gateway

SRun Login for Rust Command line login for SRun Auth Gateway. Usage ./srun_login AUTH_GW_ENDPOINT AC_ID LOCAL_IP USERNAME PASSWORD eg: ./srun_login "h

lookas 1 Oct 20, 2021
Small crate to extend `reqwest` to be able to send with digest auth flow.

diqwest This crate extends reqwest to be able to send requests with digest auth flow. It is currently implemented for async usage only. When you send

Mathias Oertel 14 Aug 29, 2022
Fast, simple and REST compliant file-server with public/private key authentication written in Rust

stormi Stormi is a fast and simple file-server with public/private key authentication How does it work? Stormi accepts multipart/form-data form with m

Polygon 2 Dec 8, 2022
Simple backend app with Actix-web, JWT and MongoDB

Actix Web JWT Example Simple backend app with Actix-web, JWT and MongoDB (JWT Token, Protect Route, Login & Register) While developing the web service

Emre 124 Dec 31, 2022
Rust library for HTTP authentication. Parses challenge lists, responds to Basic and Digest challenges. Likely to be extended with server support and additional auth schemes.

Rust library for HTTP authentication. Parses challenge lists, responds to Basic and Digest challenges. Likely to be extended with server support and a

Scott Lamb 3 Jun 10, 2022
Highly flexible library to manage and orchestrate JWT workflow

JWT Vault Highly flexible library to manage and orchestrate JWT workflow Examples | Website | Chat TODO Add more examples Improve coverage Features Ma

Saurav Gupta 65 Nov 8, 2022
A OAuth2 server library, for use in combination with actix or other frontends, featuring a set of configurable and pluggable backends.

oxide-auth A OAuth2 server library, for use in combination with common web servers, featuring a set of configurable and pluggable backends. About oxid

null 471 Dec 29, 2022
An oauth2 client implementation providing the Device, Installed and Service Account flows.

yup-oauth2 is a utility library which implements several OAuth 2.0 flows. It's mainly used by google-apis-rs, to authenticate against Google services.

Lewin Bormann 174 Dec 30, 2022
OpenSK is an open-source implementation for security keys written in Rust that supports both FIDO U2F and FIDO2 standards.

OpenSK This repository contains a Rust implementation of a FIDO2 authenticator. We developed this as a Tock OS application and it has been successfull

Google 2.4k Jan 2, 2023
Decode, explore, and sign JWTs

JWT Explorer A utility for inspecting, modifying, and attacking JWTs. Supports Windows and Linux and probably also works on macOS but this has not bee

David Young 9 Nov 9, 2022
Tools for manipulating JSON Web Tokens, JWS, JWE, and JWK in Rust

Rusty JWT Tools A collection of JWT utilities. This repository is part of the source code of Wire. You can find more information at wire.com or by con

Wire Swiss GmbH 4 Nov 22, 2022
A set of Rust libraries to interact with apple's private APIs and servers.

apple-private-apis A set of Rust libraries to interact with apple's private APIs and servers, made for use in SideInstaller. Library Description omnis

SideStore Team 4 Jan 25, 2023
Rust_cookies - cookies? cookies.

cookies? cookies. println!("{}", Cookie + Cookie); // yum yum! ?? ?? println!("{}", Cookie ); // just got 1 ?? :/ println!("{}", Cookie * 10); // 10

Marc EspΓ­n 8 Dec 15, 2022
Steals browser passwords and cookies and sends to webhook.

Browser-Stealer Steals browser passwords and cookies and sends to webhook. Donating Educational Purposes Only This code is made so you can learn from

RadonCoding 3 Sep 27, 2021
Bevy plugin to simulate and preview different types of Color Blindness.

Bevy Color Blindness Simulation Bevy plugin to simulate and preview different types of Color Blindness. This lets you ensure that your game is accessi

annie 29 Nov 22, 2022
Rustyread is a drop in replacement of badread simulate.

Rustyread is a drop in replacement of badread simulate. Rustyread is very heavily inspired by badread, it reuses the same error and quality model file. But Rustyreads is multi-threaded and benefits from other optimizations.

Pierre Marijon 20 Oct 1, 2022
Implementation of algorithms for Domain Name System (DNS) Cookies construction

DNS Cookie RFC7873 left the construction of Server Cookies to the discretion of the DNS Server (implementer) which has resulted in a gallimaufry of di

Rushmore Mushambi 2 Feb 4, 2022
An app designed to simulate real poker events to upskill players

Poker Trainer Version this application is run on: NPM: 8.17.0 Rust: 1.62.0 Available Scripts In the project directory, you can run: npm start Runs the

Tamahau Brown 2 Sep 26, 2022
rust-browser-game but native and rendered with ncurses in C without the Browser

Spin-off of rust-browser-game-but-sdl but with ncurses Nothing much to say. Just see rust-browser-game-but-sdl and rust-browser-game. Quick Start $ ma

Tsoding 8 Apr 21, 2022
The Bloat-Free Browser Game in Rust but in C and not in a Browser

rust-browser-game but native and rendered with SDL in C without the Browser The original idea of rust-browser-game is that the game.wasm module is com

Tsoding 12 Sep 26, 2022