#CURL Connections with Tor
Install Apache, PHP, CURL & Tor with apt-get
sudo apt-get install -y apache2 php5 php5-curl tor
Tor creates a proxy on your mashine with port 9050 for SOCKS5 connections.
# Install R | |
sudo apt update | |
sudo apt install gdebi libxml2-dev libssl-dev libcurl4-openssl-dev libopenblas-dev r-base r-base-dev | |
# Install RStudio | |
cd ~/Downloads | |
wget https://download1.rstudio.org/rstudio-xenial-1.1.447-amd64.deb | |
sudo gdebi rstudio-xenial-1.1.447-amd64.deb | |
printf '\nexport QT_STYLE_OVERRIDE=gtk\n' | sudo tee -a ~/.profile |
#CURL Connections with Tor
Install Apache, PHP, CURL & Tor with apt-get
sudo apt-get install -y apache2 php5 php5-curl tor
Tor creates a proxy on your mashine with port 9050 for SOCKS5 connections.
function getFileInfo($url){ | |
$ch = curl_init($url); | |
curl_setopt( $ch, CURLOPT_NOBODY, true ); | |
curl_setopt( $ch, CURLOPT_HEADER, false ); | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, false ); | |
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); | |
curl_setopt( $ch, CURLOPT_MAXREDIRS, 3 ); | |
curl_exec( $ch ); | |
$headerInfo = curl_getinfo( $ch ); | |
curl_close( $ch ); |
// ==UserScript== | |
// @name Best Subtitle Downloader for youtube, ted, vimeo, dramafever and more. Auto subtitle supported. | |
// @namespace https://distillvideo.com/ | |
// @version 2.1 | |
// @date 2018-06-23 | |
// @description Download subtitles or captions from Youtube, TED, Vimeo, Dramafever, Dailymotion, etc. Support mutiple languages. For Youtube, both closed captions (CC) and automatic captions (auto-generated subtitles) can be downloaded if they are available. Fast and easy to use. | |
// @author DistillVideo.com | |
// @copyright 2018, DistillVideo.com | |
// @homepage https://distillvideo.com/page/extensions | |
// @compatible chrome |
// ==UserScript== | |
// @name Distill Video & Audio Downloader from 5000+ sites including Youtube, Support 1080P, 2K, 4k & 8K | |
// @namespace https://distillvideo.com/ | |
// @version 2.1.1 | |
// @date 2018-06-17 | |
// @description Browser extension to download video and audio from Youtube, Twitter, Vimeo, Facebook, Dailymotion, 1tv, VK, youku, bilibili and 5000 more sites for free. Fast and easy to use. | |
// @author DistillVideo.com | |
// @copyright 2018, DistillVideo.com | |
// @homepage https://distillvideo.com/page/extensions | |
// @downloadURL https://distillvideo.com/js/ditillvideo.user.js |
// ==UserScript== | |
// @name DistillVideo Downloader | |
// @namespace https://distillvideo.com/ | |
// @version 1.0 | |
// @description Browser extension to download videos | |
// @author DistillVideo | |
// @copyright 2018, DistillVideo | |
// @homepage https://distillvideo.com/page/extensions | |
// @downloadURL https://distillvideo.com/js/ditillvideo.user.js | |
// @match *://*.youtube.com/* |
* In php, the function "get_headers" sometimes is slow, especially if you want to get headers of a batch of urls in parallel. | |
* In this case, you should use curl. | |
function get_headers_curl($url){ | |
$curl = curl_init(); | |
curl_setopt_array( $curl, array( | |
CURLOPT_HEADER => true, | |
CURLOPT_NOBODY => true, | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_URL => $url)); |
Since python 2.x will be deprecated in 2020, it is better to use python 3.x for youtube-dl. | |
Plus, python 3.6 runs faster. But for ubuntu, normaly, youtube-dl just uses python 2.x. | |
Here is how to force youtube-dl to use python 3.6. | |
*1.Install python3.6 according to this gist: | |
https://gist.github.com/thodison/3dfcff7d09560357c9c6a9b453e0d6ed | |
*2.Edit ~/.bashrc | |
Add the folloing line on the top, then save and close it: | |
alias python3="python3.6" |
**** | |
* For the Ubuntu 14.04 system, it is not easay to install python 3.6 and make pip3 work using the python3.6.4 path. If installed from the repository with ppa:jonathonf/python-3.6, | |
* there are always problems to use pip3 to call python 3.6.4. So this gist will help to solve such problems. | |
****** | |
sudo apt-get install build-essential checkinstallsudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev | |
cd ~ | |
sudo wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz | |
sudo tar xzf Python-3.6.4.tgz |