Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
611e8a1
Update README.md
zakky20 Aug 13, 2025
bf2cdb5
Update README.md
zakky20 Aug 13, 2025
15d611b
Update README.md
zakky20 Aug 13, 2025
75cfee7
Update README.md
zakky20 Aug 13, 2025
942d365
Update README.md
zakky20 Aug 13, 2025
9a74627
Update README.md
zakky20 Aug 13, 2025
7039ad7
Add files via upload
zakky20 Aug 13, 2025
5631b64
The dmenu implementation for notflix
zakky20 Aug 13, 2025
dc19c8c
Update README.md
zakky20 Aug 13, 2025
ce64581
Update README.md
zakky20 Aug 13, 2025
3862b61
Delete old preview
zakky20 Aug 13, 2025
d2bb01c
Update README.md
zakky20 Aug 13, 2025
0f8dfd5
Update README.md
zakky20 Aug 13, 2025
1a4b958
Update README.md
zakky20 Aug 13, 2025
02f444e
Update README.md
zakky20 Aug 13, 2025
31b80e8
Update README.md
zakky20 Aug 13, 2025
393c01c
Update README.md
zakky20 Aug 13, 2025
a9ae44c
Update README.md
zakky20 Aug 13, 2025
6da8805
Update README.md
zakky20 Aug 13, 2025
4662246
Update README.md
zakky20 Aug 13, 2025
9a01a53
Update README.md
zakky20 Aug 13, 2025
f1a92bb
Update README.md
zakky20 Aug 13, 2025
e2cc845
Update README.md
zakky20 Aug 13, 2025
9701394
Update README.md
zakky20 Aug 13, 2025
88b0904
Update README.md
zakky20 Aug 13, 2025
4a80175
Update README.md
zakky20 Aug 13, 2025
dfc8694
Update README.md
zakky20 Aug 13, 2025
9f5fa1e
Update README.md
zakky20 Aug 13, 2025
5b29713
Update README.md
zakky20 Aug 13, 2025
4424db8
Update notflix
zakky20 Aug 13, 2025
3fe9473
Update README.md
zakky20 Aug 13, 2025
e191895
Update README.md
zakky20 Aug 13, 2025
72893af
Update README.md
zakky20 Aug 13, 2025
2d861af
Update README.md
zakky20 Aug 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
<h1 align="center">NOTFLIX</h1>
<p align="center">f@#k netflix use notflix a tool which search magnet links and stream it with peerflix</p>
<p align="center">f@#k netflix use notflix a tool which search magnet links with dmenu and streams it with webtorrent-cli</p>

##
<p align="center">
<img src="./preview.gif" alt="Video Preview" width="500px">
<img src="./notflix.gif" alt="Video Preview" width="500px">
</p>

> Watch this video to understand - [bugswriter's notflix](https://youtu.be/FbE19_omaWY)
> Watch this video to understand the script better- [bugswriter's notflix video](https://youtu.be/FbE19_omaWY)

### How does this work?

This is a shell script. It scape 1337x and get the magnet link.
After this it use [peerflix](https://github.com/mafintosh/peerflix) to stream the video from magnet link.
For scraping script use simple gnu utils like sed, awk, paste, cut.
This is a dmenu script. It searches 1337x and gets the magnet link for which media u choose.
After this it uses [webtorrent-cli](https://github.com/webtorrent/webtorrent-cli) to stream the video with mpv from the magnet link.
For scraping script it uses simple gnu utils like sed, awk, paste, grep, cut.

## Requirements
## Requirements / Dependencies

* [peerflix](https://github.com/mafintosh/peerflix) - A tool to stream torrent. `sudo npm install peerflix -g`
* [webtorrent-cli](https://github.com/webtorrent/webtorrent-cli) - A tool to stream torrent. `sudo npm install webtorrent-cli -g` or `paru -S webtorrent-cli` / `yay -S webtorrent-cli` for Arch Linux Users

## Installation

### cURL
cURL **notflix** to your **$PATH** and give execute permissions.

```sh
$ sudo curl -sL "https://raw.githubusercontent.com/Bugswriter/notflix/master/notflix" -o /usr/local/bin/notflix
$ sudo chmod +x /usr/local/bin/notflix
--- If you are using sudo ---
sudo curl -sL "https://raw.githubusercontent.com/zakky20/notflix-dmenu/master/notflix" -o /usr/local/bin/notflix
sudo chmod +x /usr/local/bin/notflix

--- If you are using doas instead of sudo ---
doas curl -sL "https://raw.githubusercontent.com/zakky20/notflix-dmenu/master/notflix" -o /usr/local/bin/notflix
doas chmod +x /usr/local/bin/notflix
```
- To update, just do `curl` again, no need to `chmod` anymore.
- To uninstall, simply remove `notflix` from your **$PATH**, for example `sudo rm -f /usr/local/bin/notflix.

## License
This project is licensed under [GPL-3.0](https://raw.githubusercontent.com/Illumina/licenses/master/gpl-3.0.txt).

79 changes: 74 additions & 5 deletions notflix
Original file line number Diff line number Diff line change
@@ -1,6 +1,75 @@
#!/bin/sh
#!/usr/bin/env bash

query=$(printf '%s' "$*" | tr ' ' '+' )
movie=$(curl -s https://1337x.to/search/$query/1/ | grep -Eo "torrent\/[0-9]{7}\/[a-zA-Z0-9?%-]*/" | head -n 1)
magnet=$(curl -s https://1337x.to/$movie | grep -Po "magnet:\?xt=urn:btih:[a-zA-Z0-9]*" | head -n 1)
peerflix -l -k $magnet
mkdir -p $HOME/.cache/notflix

menu="dmenu -i -l 20"
baseurl="https://1337x.to"
cachedir="$HOME/.cache/notflix"

category=$(dmenu -p "Movies? TV? Documentaries? Anime? (1,2,3,4): " <&-)
case $category in
"1") category="Movies" ;;
"2") category="TV" ;;
"3") category="Documentaries" ;;
"4") category="Anime" ;;
*) category="Movies" ;;
esac

if [ -z $1 ]; then
query=$(dmenu -p "Search Torrent: " <&-)
else
query=$1
fi
query="$(echo $query | sed 's/ /+/g')"

curl -s "$baseurl/category-search/$query/$category/1/" >"$cachedir/tmp.html"

grep -o '<a href="/torrent/.*</a>' "$cachedir/tmp.html" |
sed 's/<[^>]*>//g' >"$cachedir/titles.bw"

result_count=$(wc -l "$cachedir/titles.bw" | awk '{print $1}')
if [ "$result_count" -lt 1 ]; then
notify-send "No Result found. Try again" -i "NONE"
exit 0
fi

grep -o '<td class="coll-2 seeds.*</td>\|<td class="coll-3 leeches.*</td>' "$cachedir/tmp.html" |
sed 's/<[^>]*>//g' | sed 'N;s/\n/ /' >"$cachedir/seedleech.bw"

grep -o '<td class="coll-4 size.*</td>' "$cachedir/tmp.html" |
sed 's/<span class="seeds">.*<\/span>//g' |
sed -e 's/<[^>]*>//g' >"$cachedir/size.bw"

grep -E '/torrent/' "$cachedir/tmp.html" |
sed -E 's#.*(/torrent/.*)/">.*#\1#' >"$cachedir/links.bw"

sed 's/\./ /g; s/\-/ /g' "$cachedir/titles.bw" |
sed 's/[^A-Za-z0-9 ]//g' | tr -s " " >"$cachedir/tmp" && mv "$cachedir/tmp" "$cachedir/titles.bw"

awk '{print NR " - ["$0"]"}' "$cachedir/size.bw" >"$cachedir/tmp" && mv "$cachedir/tmp" "$cachedir/size.bw"
awk '{print "[S:"$1 ", L:"$2"]" }' "$cachedir/seedleech.bw" >"$cachedir/tmp" && mv "$cachedir/tmp" "$cachedir/seedleech.bw"

LINE=$(paste -d\ "$cachedir/size.bw" "$cachedir/seedleech.bw" "$cachedir/titles.bw" |
$menu |
cut -d\- -f1 |
awk '{$1=$1; print}')

if [ -z "$LINE" ]; then
notify-send "No Result selected. Exiting..." -i "NONE"
exit 0
fi

notify-send "Searching Magnet seeds" -i "NONE"

url=$(head -n $LINE "$cachedir/links.bw" | tail -n +$LINE)
fullURL="${baseurl}${url}/"
curl -s "$fullURL" >"$cachedir/tmp.html"

magnet=$(grep -Po 'href="magnet:\?xt=urn:btih:[^"]+"' "$cachedir/tmp.html" | head -n 1 | sed 's/href="//;s/"$//')

if [ -z "$magnet" ]; then
notify-send "Magnet link not found" -i "NONE"
exit 0
fi
webtorrent "$magnet" --mpv
notify-send "Enjoy!" -i "NONE"
Binary file added notflix.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed preview.gif
Binary file not shown.