Skip to content

Commit

Permalink
Added librewolf (#178)
Browse files Browse the repository at this point in the history
* added-librewolf

* added tests for librewolf

* added librewolf in windows

* formatting

* more formatting

* revert edge driver

* fixed macos path for librewolf

* bumped version and updated README.md
  • Loading branch information
rafiibrahim8 authored Jun 5, 2023
1 parent 1a3c26d commit 216bf01
Show file tree
Hide file tree
Showing 11 changed files with 512 additions and 275 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/test_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,31 @@ jobs:
curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo tee /usr/share/keyrings/vivaldi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/vivaldi-archive-keyring.gpg] https://repo.vivaldi.com/archive/deb/ stable main" | sudo tee /etc/apt/sources.list.d/vivaldi.list > /dev/null
distro=$(if echo " una vanessa focal jammy bullseye vera uma" | grep -q " $(lsb_release -sc) "; then echo $(lsb_release -sc); else echo focal; fi)
curl -fsSL https://deb.librewolf.net/keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/librewolf.gpg
sudo tee /etc/apt/sources.list.d/librewolf.sources << EOF > /dev/null
Types: deb
URIs: https://deb.librewolf.net
Suites: $distro
Components: main
Architectures: amd64
Signed-By: /usr/share/keyrings/librewolf.gpg
EOF
sudo apt update
sudo apt install -y opera-stable brave-browser vivaldi-stable
sudo apt install -y opera-stable brave-browser vivaldi-stable librewolf
# chrome, chromium, edge, and firefox are already installed
# See: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
- name: Install patched geckodriver
run: |
tag=$(curl -fsSL 'https://api.github.com/repos/rafiibrahim8/geckodriver-unchained/releases/latest' | jq -r '.tag_name')
mkdir -p ~/.local/bin
curl -Lo ~/.local/bin/geckodriver "https://github.com/rafiibrahim8/geckodriver-unchained/releases/download/$tag/geckodriver-unchained-linux-$tag"
chmod +x ~/.local/bin/geckodriver
echo "GECKOWEBDRIVER=$HOME/.local/bin/geckodriver" >> "$GITHUB_ENV"
- name: Install Python Dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
python-version: 3.11
- name: Install Browsers
run: |
choco install -y opera opera-gx brave chromium vivaldi --no-progress
choco install -y opera opera-gx brave chromium vivaldi librewolf --no-progress
# chrome, edge, and firefox are already installed
# See: https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.19.0
- [MODULE] Added new browser support: LibreWolf
- [MODULE] Added `immutable` mode for opening cookies database
- [Chromium based] Added paths for flatpak installations
### 0.18.2
- [MODULE] Added tests
### 0.18.1
Expand Down
50 changes: 30 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

This is a python3 fork of [Richard Penman's Browser Cookie](https://github.com/richardpenman/browsercookie)

# Browser Cookie #
# Browser Cookie

* ***What does it do?*** Loads cookies used by your web browser into a cookiejar object.
* ***Why is it useful?*** This means you can use python to download and get the same content you see in the web browser without needing to login.
* ***Which browsers are supported?*** Currently Chrome, Firefox, Opera, Opera GX, Edge, Chromium, Brave, Vivaldi, and Safari.
* ***Which browsers are supported?*** Chrome, Firefox, LibreWolf, Opera, Opera GX, Edge, Chromium, Brave, Vivaldi, and Safari.
* ***How are the cookies stored?*** All currently-supported browsers store cookies in a sqlite database in your home directory.

## Install ##
## Install
```bash
pip install browser-cookie3
```

## Usage ##
## Usage

Here is a *dangerous* hack to extract the title from a webpage:
```python
Expand Down Expand Up @@ -96,28 +96,38 @@ Run `google-chrome-stable --user-data-dir=browser_cookie3 #replace google-chrome
If you want to share a cookie file then visit some site that will generate cookie (without logging in!), example https://www.theverge.com/ will save cookies after you accept the GDPR notice.

## Planned backwards incompatible changes for 1.0
- more sensible cookie file checking order, like first using the default defined in profiles.ini for firefox
- more sensible cookie file checking order, like first using the default defined in profiles.ini for FireFox-based browsers

## Contribute ##
## Contribute
So far the following platforms are supported:

* **Chrome:** Linux, OSX, Windows
* **Firefox:** Linux, OSX, Windows
* **Opera:** Linux, OSX, Windows
* **Opera GX:** OSX, Windows
* **Edge:** Linux, OSX, Windows
* **Chromium:** Linux, OSX, Windows
* **Brave:** Linux, OSX, Windows
* **Vivaldi:** Linux, OSX, Windows
* **Safari:** OSX
* **Chrome:** Linux, MacOS, Windows
* **Firefox:** Linux, MacOS, Windows
* **LibreWolf:** Linux, MacOS, Windows
* **Opera:** Linux, MacOS, Windows
* **Opera GX:** MacOS, Windows
* **Edge:** Linux, MacOS, Windows
* **Chromium:** Linux, MacOS, Windows
* **Brave:** Linux, MacOS, Windows
* **Vivaldi:** Linux, MacOS, Windows
* **Safari:** MacOS

You are welcome to contribute support for other browsers, or other platforms.

## Testing Dates (dd/mm/yy)

OS | Chrome | Firefox | Opera | Opera GX | Edge | Chromium | Brave | Vivaldi | Safari |
:------ | :------: | :-----: | :-----: | :--------: | :------: | :------: | :------: | :------: | :------: |
Mac | 31/01/23 | 09/12/20 | 31/01/23 | 31/01/23 | 31/01/23 | 15/06/22 | 31/01/23 | 31/01/23 | 31/01/23 |
Linux | 31/01/23 | 09/12/20 | 31/01/23 | - | 31/01/23 | 07/24/21 | 31/01/23 | 31/01/23 | - |
Windows | 31/01/23 | 09/12/20 | 31/01/23 | 31/01/23 | 31/01/23 | 15/06/22 | 31/01/23 | 15/06/22 | - |
Browser | Linux | MacOS | Windows |
:------ | :------: | :------: | :------: |
Chrome | 31/01/23 | 31/01/23 | 31/01/23 |
Firefox | 05/06/23 | 05/06/23 | 05/06/23 |
LibreWolf| 05/06/23 | 05/06/23 | 05/06/23 |
Opera | 31/01/23 | 31/01/23 | 31/01/23 |
Opera GX | - | 31/01/23 | 31/01/23 |
Edge | 31/01/23 | 31/01/23 | 31/01/23 |
Chromium | 07/24/21 | 15/06/22 | 15/06/22 |
Brave | 31/01/23 | 31/01/23 | 31/01/23 |
Vivaldi | 31/01/23 | 31/01/23 | 15/06/22 |
Safari | - | 31/01/23 | - |

However I only tested on a single version of each browser and so am not sure if the cookie sqlite format changes location or format in earlier/later versions. If you experience a problem please [open an issue](https://github.com/borisbabic/browser_cookie3/issues/new) which includes details of the browser version and operating system. Also patches to support other browsers are very welcome, particularly for Chrome and Internet Explorer on Windows.

Expand Down
Loading

0 comments on commit 216bf01

Please sign in to comment.