Skip to content

Commit

Permalink
add the streaming features
Browse files Browse the repository at this point in the history
  • Loading branch information
lkabuci committed Jan 24, 2022
1 parent f11b1e3 commit ccd0a6a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Torrent
# IT_Streams
### Stream your favorite movies in your terminal

## Installation:
...
28 changes: 18 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import requests
from bs4 import BeautifulSoup
from prettytable import PrettyTable
import pyperclip
import subprocess


def get_titles():
Expand All @@ -30,6 +30,7 @@ def get_titles():
title.append(i)
return title


def get_magnet_links():
'''this function search for the magnet links'''
magnet = []
Expand All @@ -40,6 +41,7 @@ def get_magnet_links():
return magnet



search = input("What are you searching for? ").split(" ")
search = "+".join(search)

Expand Down Expand Up @@ -78,17 +80,23 @@ def selection(magnet):

lenght = [item for item in range(len(magnet))]
is_invalid = True

# while is_invalid:
# number = input("Enter Your Choice: ")
# if number in lenght:
# is_invalid = False
# else:
# print("Please enter a valid choice")
# TODO: add a check if the number is valid or not

number = int(input("Enter Your Choice: "))

return magnet[number]

pyperclip.copy(selection(magnet))
spam = pyperclip.paste()
def stream(magnet):
# TODO: add the ability to check if a vlc or other video player exist
# supported player
# DNLA
# MPlayer
# MPV
# OMX
# VLC
# IINA
# SMPlayer
# XBMC
subprocess.run(["webtorrent", magnet, "--mpv"])

stream(selection(magnet))
11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# TODO: configure the setup script

import setuptools

setuptools.setup(
name='itstreams',
version='0.1',
install_requires=["requests", "BeautifulSoup4", "prettytable", "subprocess"],
scripts=['itstreams']
)

0 comments on commit ccd0a6a

Please sign in to comment.