guneysus
5/3/2015 - 7:42 PM

Google Chrome Extension Downloader Script

Google Chrome Extension Downloader Script

#!/usr/bin/env bash
# 2015, 3 May
# Author: https://github.com/guneysus
# -----------------------------------------------------------------------------
# For more details:
# See http://stackoverflow.com/a/14099762/1766716
# and # https://github.com/Rob--W/crxviewer/blob/master/src/cws_pattern.js
# -----------------------------------------------------------------------------
# Usage
# get_crx.sh -i=caiohnhmoonpkpaejaggklhhgnkepnog -v=42.0.2311.135
# get_crx.sh --crxid=caiohnhmoonpkpaejaggklhhgnkepnog --version=42.0.2311.135
# get_crx.sh --crxid=caiohnhmoonpkpaejaggklhhgnkepnog --version=43
# -----------------------------------------------------------------------------
for i in "$@"
do
case $i in
    -v=*|--version=*)
    PRODVERSION="${i#*=}"
    ;;
    -i=*|--crxid=*)
    CRX_ID="${i#*=}"
    ;;
    *)
    ;;
esac
done

URI="https://clients2.google.com/service/update2/crx?response=redirect&prodversion=${PRODVERSION}&x=id%3D${CRX_ID}%26uc";

wget --no-check-certificate ${URI} -O "${CRX_ID}.zip"