├── README.md ├── 1fichier.sh └── LICENSE.txt /README.md: -------------------------------------------------------------------------------- 1 | # Downloader for 1fichier.com using Tor 2 | 3 | Content in [Tor](https://www.torproject.org/) is often saved on hosters like [1fichier.com](https://1fichier.com/). 4 | 5 | A user named SoupeAuLait from the board Rindexxx (no longer available) wrote a script to download files from 1fichier.com. The script changed the circuit of Tor until a "free slot" for 1fichier.com was found and downloaded the file. 6 | 7 | I grabbed this script and rewrote most parts of it. My improvements are 8 | - Improve readability (speaking variables, proper indentation, ...). 9 | - Prefer local variables instead of global ones. 10 | - Allowed mass downloading by putting all links into a text file. 11 | - Skip already downloaded files. 12 | - Verify downloaded files (very limited). 13 | - Use temp folder for all temporary files. 14 | - Remove temporary files after download. 15 | 16 | ## Usage 17 | 18 | `./1fichier.sh File-With-URLs` 19 | 20 | or 21 | 22 | `./1fichier.sh URL` 23 | 24 | ## Contact 25 | 26 | Author: eismann 27 | 28 | Freemail: eismann@vu6osveg7rpxh2ckrh7ivdyilprn52px2gtxtp4bxjckn46oc6ia.freemail [^1] 29 | 30 | Frost: eismann@5H+yXYkQHMnwtQDzJB8thVYAAIs 31 | 32 | FMS: eismann 33 | 34 | Sone: [eismann](http://localhost:8888/Sone/viewSone.html?sone=rTzpVIb8X3PoSon~io8IW~Le6ffRp3m-gbpEpvPOF5A) [^2] 35 | 36 | I do not regularly read the email associated with GitHub. 37 | 38 | ## License 39 | 40 | 1fichier.sh by eismann@5H+yXYkQHMnwtQDzJB8thVYAAIs is licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). 41 | 42 | [^1]: Freemail requires a running Hyphanet node 43 | [^2]: Link requires a running Hyphanet node at http://localhost:8888/ 44 | -------------------------------------------------------------------------------- /1fichier.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2021-2023 eismann@5H+yXYkQHMnwtQDzJB8thVYAAIs 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Some lines were taken from the script 1fichier.sh by SoupeAuLait@Rindexxx 18 | 19 | 20 | checkTor() { 21 | local torPort= 22 | for port in 9050 9150 ; do 23 | echo "" 2>/dev/null > /dev/tcp/127.0.0.1/${port} 24 | if [ "$?" = "0" ] ; then 25 | torPort=${port} 26 | fi 27 | done 28 | echo ${torPort} 29 | } 30 | 31 | 32 | tcurl(){ 33 | curl --proxy "socks5h://${torUser}:${torPassword}@127.0.0.1:${torPort}" --connect-timeout 15 --user-agent "Mozilla/5.0 (Windows NT 10.0; rv:109.0) Gecko/20100101 Firefox/115.0" --header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8" --header "Accept-Language: en-US,en;q=0.5" --header "Accept-Encoding: gzip, deflate, br" --compressed "$@" 34 | } 35 | 36 | 37 | failedDownload() { 38 | local baseDir=${1} 39 | local url=${2} 40 | echo "${url}" >> "${baseDir}/failed.txt" 41 | } 42 | 43 | 44 | removeTempDir() { 45 | local tempDir=${1} 46 | rm --recursive "${tempDir}" 47 | } 48 | 49 | 50 | removeCookies() { 51 | local cookieFile=${1} 52 | rm --force "${cookieFile}" 53 | } 54 | 55 | 56 | cancelDownload() { 57 | echo "Download cancelled." 58 | removeTempDir "${lastTempDir}" 59 | exit 1 60 | } 61 | 62 | 63 | downloadFile() { 64 | trap cancelDownload SIGINT SIGTERM 65 | 66 | local url=${1} 67 | echo "Processing \"${url}\""... 68 | echo -n "Search for a circuit without wait time..." 69 | 70 | local baseDir=$(pwd) 71 | local tempDir=${baseDir}/$(mktemp --directory "tmp.XXX") 72 | lastTempDir=${tempDir} 73 | 74 | local filenameRegEx='>Filename :<.*