Commit cd2a76f0 authored by prx's avatar prx

major update. Separated lib

parent 9f5cefaa
all:
find . -name '*.pyc' -exec rm '{}' \;
find . -name '*.deb' -exec rm '{}' \;
find . -name '*.tar.gz' -exec rm '{}' \;
find . -name '*.dsc' -exec rm '{}' \;
find . -name '*.changes' -exec rm '{}' \;
find . -name '*.*un\~' -exec rm '{}' \;
#equivs-build eqctl -f
#equivs-build eqctl
#mv *.deb ./site/downloads/dontpanic-latest.deb
# vim:set ft=make:
#!/bin/sh
# start dontpanic as single user or the server
PYTHON=$(which python3)
PYTHON=$(which python3.4)
if [ $? -ne 0 ]; then
PYTHON=$(which python)
PYTHON=$(which python3)
fi
if [ $? -ne 0 ]; then
PYTHON=$(which python2.7)
fi
if [ -d /usr/share/dontpanic ]; then
cd /usr/share/dontpanic
elif [ -d ./src ]; then
cd src
fi
if [ -e ./dontpanic.py ]; then
......
No preview for this file type
......@@ -2,7 +2,7 @@
#Auteur : thuban <thuban@yeuxdelibad.net>
REP=~/geek/gitreps/3hg/dontpanic
OUT=~/geek/gitreps/3hg-website/dontpanic/downloads/
OUT=~/geek/gitreps/3hg/3hg-website/dontpanic/downloads/
if [ -d /tmp/dontpanic ]; then
rm -rf /tmp/dontpanic
......@@ -14,7 +14,7 @@ cp -r * /tmp/dontpanic
rm -r /tmp/dontpanic/site
cd /tmp
tar cvzf "dontpanic-latest.tgz" "dontpanic"
mv dontpanic-latest.tgz $OUT
mv /tmp/dontpanic-latest.tgz $OUT/
exit
......@@ -18,9 +18,9 @@ import sys
from argparse import ArgumentParser
from dontpanic import DontPanic
from i18n import _
from utils import setup_logging, progname, progversion
from dontpanic.ui import DontPanic
from dontpanic.i18n import _
from dontpanic.utils import setup_logging, progname, progversion
serverlist = ["cgi", "paste", "cherrypy", "tornado", "auto"]
logger = logging.getLogger(__name__)
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Auteur : thuban <thuban@yeuxdelibad.net>
licence : MIT
Description :
Just watch your favorite show and keep track of them.
"""
import getpass
import sys
import os
from argparse import ArgumentParser
from dontpanic.ui import *
logger = logging.getLogger(__name__)
if __name__ == '__main__':
parser = ArgumentParser(prog=progname, description=_("Dontpanic is a python app to look for any movie or"
" serie and watch them in streaming. It looks like popcorntime"
", but doesn't depend of a centralized api."))
parser.add_argument("-v", "--verbose", action="count", default=0, help=_("Increase output verbosity"))
parser.add_argument("--version", action="version", version=progversion, help=_("Print version"))
parser.add_argument("magnet", nargs='?', action="store", default="", help=_("Stream a magnet link"))
args = parser.parse_args()
setup_logging(args.verbose)
os.chdir(os.path.dirname(os.path.abspath(__file__)))
prepconfig()
port = lock()
# In case if the login contains weird characters
if sys.platform == 'win32' and sys.version_info < (3, 0):
me = getpass.getuser().decode('utf-8', errors='ignore')
else:
me = getpass.getuser()
# a magnet link is passed as argument
mgt = ""
if args.magnet.startswith("magnet:"):
mgt = quoteurl(args.magnet)
if not port: # already running
with open(lock_file, 'r') as l:
port = l.read().strip()
if mgt != "":
webbrowser.open("http://localhost:{}/stream/dontpanic/{}/0".format(port, mgt))
else:
webbrowser.open("http://localhost:{}".format(port))
else:
myapp = DontPanic('localhost', port, me, magnet=mgt)
myapp.run()
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
......@@ -7,7 +7,7 @@ import os
import logging
import sys
from utils import confdir
from .utils import confdir
logger = logging.getLogger(__name__)
......
......@@ -14,8 +14,8 @@ import logging
import os
import sys
from utils import progname, progversion, progurl, get_hash
from webutils import do_req_get
from .utils import progname, progversion, progurl, get_hash
from .webutils import do_req_get
logger = logging.getLogger(__name__)
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding:Utf-8 -*-
"""
Auteur : thuban <thuban@yeuxdelibad.net>
licence : MIT
Description :
Just watch your favorite show and keep track of them.
Auteur : thuban <thuban@yeuxdelibad.net>
licence : MIT
"""
import getpass
import sys
from argparse import ArgumentParser
from bottle import *
from threading import Thread
import webbrowser
from database import DontPanicDB
from i18n import _
import locale
from subtitle import Subtitle
from torrentsession import TorrentSession
from utils import *
from webutils import *
from .database import DontPanicDB
from .i18n import _
from .subtitle import Subtitle
from .torrentsession import TorrentSession
from .utils import *
from .webutils import *
if sys.version_info >= (3, 0):
from urllib.parse import quote as quoteurl
else:
from urllib import quote as quoteurl
logger = logging.getLogger(__name__)
import locale
def search2html(keywords, extrawords=' ', searchengine='kickasstorrents', page=0, isserie=0):
"""
......@@ -317,6 +309,8 @@ def pick_logo():
return "favicon.png"
class DontPanic:
def __init__(self, host, port, admin, adminpw="password", local_=True, magnet=""):
self.startperc = None
......@@ -985,43 +979,3 @@ class DontPanic:
del session
if __name__ == '__main__':
parser = ArgumentParser(prog=progname, description=_("Dontpanic is a python app to look for any movie or"
" serie and watch them in streaming. It looks like popcorntime"
", but doesn't depend of a centralized api."))
parser.add_argument("-v", "--verbose", action="count", default=0, help=_("Increase output verbosity"))
parser.add_argument("--version", action="version", version=progversion, help=_("Print version"))
parser.add_argument("magnet", nargs='?', action="store", default="", help=_("Stream a magnet link"))
args = parser.parse_args()
setup_logging(args.verbose)
os.chdir(os.path.dirname(os.path.abspath(__file__)))
prepconfig()
port = lock()
# In case if the login contains weird characters
if sys.platform == 'win32' and sys.version_info < (3, 0):
me = getpass.getuser().decode('utf-8', errors='ignore')
else:
me = getpass.getuser()
# a magnet link is passed as argument
mgt = ""
if args.magnet.startswith("magnet:"):
mgt = quoteurl(args.magnet)
if not port: # already running
with open(lock_file, 'r') as l:
port = l.read().strip()
if mgt != "":
webbrowser.open("http://localhost:{}/stream/dontpanic/{}/0".format(port, mgt))
else:
webbrowser.open("http://localhost:{}".format(port))
else:
myapp = DontPanic('localhost', port, me, magnet=mgt)
myapp.run()
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
......@@ -16,7 +16,7 @@ if sys.version_info >= (3, 0):
else:
import ConfigParser as cp
from i18n import _
from .i18n import _
####################
# Global variables #
......
......@@ -4,9 +4,8 @@ import sys
import requests
import bs4
from utils import convb
from i18n import _
from .utils import convb
from .i18n import _
if sys.version_info >= (3, 0):
from concurrent.futures import ThreadPoolExecutor
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-04-21 18:06+0200\n"
"POT-Creation-Date: 2016-09-16 08:05+0200\n"
"PO-Revision-Date: 2016-01-11 10:28+0100\n"
"Last-Translator: Xavier Cartron <thuban@yeuxdelibad.net>\n"
"Language-Team: French\n"
......@@ -18,507 +18,449 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: translation.py:61
msgid "Update translation for Dontpanic."
msgstr ""
#: translation.py:63 dontpanic.py:985 dontpanic-server.py:64
msgid "Increase output verbosity"
msgstr ""
#: translation.py:65
msgid "Update template for translators"
msgstr ""
#: translation.py:66
msgid "Update .po files from .pot file"
msgstr ""
#: translation.py:67
msgid "Compile .po files into .mo files"
msgstr ""
#: dontpanic.py:63
msgid "Name"
msgstr ""
#: dontpanic.py:64
msgid "Size"
msgstr ""
#: dontpanic.py:65
msgid "Leechs"
msgstr ""
#: dontpanic.py:66
msgid "Seeds"
#: dontpanic/utils.py:62
msgid "What do we watch tonight?"
msgstr ""
#: dontpanic.py:100
msgid "More results"
#: dontpanic/utils.py:63
msgid "Don't forget your towel"
msgstr ""
#: dontpanic.py:103
msgid "There is no result for your search, try something else"
#: dontpanic/utils.py:64
msgid "Do you have pizza?"
msgstr ""
#: dontpanic.py:140
msgid "Season"
#: dontpanic/utils.py:65
msgid "Type and watch"
msgstr ""
#: dontpanic.py:141
msgid "Episode"
#: dontpanic/utils.py:66
msgid "Turn off the lights"
msgstr ""
#: dontpanic.py:142 dontpanic.py:288 dontpanic.py:297
msgid "Title"
#: dontpanic/utils.py:67
msgid "Get some beer before searching"
msgstr ""
#: dontpanic.py:143
msgid "Release date"
#: dontpanic/utils.py:306
msgid "About"
msgstr ""
#: dontpanic.py:144
msgid "Seen"
#: dontpanic/utils.py:307
msgid "Back to main page"
msgstr ""
#: dontpanic.py:167
msgid "Yes"
#: dontpanic/utils.py:308
msgid "Movie or serie title"
msgstr ""
#: dontpanic.py:167
msgid "No"
#: dontpanic/utils.py:309
msgid "Best DVD's"
msgstr ""
#: dontpanic.py:227
msgid "Do you mean ? "
#: dontpanic/utils.py:310
msgid "Popular series"
msgstr ""
#: dontpanic.py:270
msgid "Watch again"
#: dontpanic/utils.py:311
msgid "Configuration"
msgstr ""
#: dontpanic.py:271
msgid "Remove"
#: dontpanic/utils.py:312
msgid "in cache"
msgstr ""
#: dontpanic.py:288 dontpanic.py:297
msgid "Date"
#: dontpanic/utils.py:313
msgid "Remove all finished torrents"
msgstr ""
#: dontpanic.py:410 dontpanic.py:443 dontpanic.py:772
msgid "Username"
#: dontpanic/utils.py:314
msgid "Show play link at"
msgstr ""
#: dontpanic.py:410 dontpanic.py:443 dontpanic.py:773
msgid "Password"
#: dontpanic/utils.py:315
msgid "Set upload limit in kB (-1 is no limit):"
msgstr ""
#: dontpanic.py:410 dontpanic.py:443 dontpanic.py:774
msgid "Login"
#: dontpanic/utils.py:316
msgid "Set download limit in kB (-1 is no limit):"
msgstr ""
#: dontpanic.py:410 dontpanic.py:443
msgid "Register"
#: dontpanic/utils.py:317
msgid "Apply General & Proxy changes"
msgstr ""
#: dontpanic.py:427
msgid "Your login information was incorrect"
#: dontpanic/utils.py:318
msgid "Don't Panic must be restarted for some options to apply"
msgstr ""
#: dontpanic.py:454
msgid "Congratulations, your subscription is a success"
#: dontpanic/utils.py:319
msgid "Background image"
msgstr ""
#: dontpanic.py:454
msgid "Now, log in"
#: dontpanic/utils.py:320
msgid "Your page"
msgstr ""
#: dontpanic.py:456
msgid "Oh no!"
#: dontpanic/utils.py:321
msgid "Storage"
msgstr ""
#: dontpanic.py:456
msgid "User {} already exists"
#: dontpanic/utils.py:322
msgid "General"
msgstr ""
#: dontpanic.py:462
msgid "You're not logged in"
#: dontpanic/utils.py:323
msgid "Administration"
msgstr ""
#: dontpanic.py:466
msgid "Your account is deleted"
#: dontpanic/utils.py:324
msgid "Stop Don't Panic"
msgstr ""
#: dontpanic.py:468
msgid ""
"An error occurred while deleting your account. Please contact the "
"administrator"
#: dontpanic/utils.py:325
msgid "This is your page"
msgstr ""
#: dontpanic.py:472 utils.py:306
#: dontpanic/utils.py:326 dontpanic/ui.py:462
msgid "Unsubscribe"
msgstr ""
#: dontpanic.py:511 dontpanic.py:540
msgid "Error while searching. Try another engine"
msgstr ""
#: dontpanic.py:640
msgid "Stop this download"
#: dontpanic/utils.py:327
msgid "Log out"
msgstr ""
#: dontpanic.py:650
msgid "Play"
#: dontpanic/utils.py:328
msgid "Watchlist"
msgstr ""
#: dontpanic.py:652
msgid "Find subtitles"
#: dontpanic/utils.py:329
msgid "Movies"
msgstr ""
#: dontpanic.py:664
msgid "Only the administrator can delete a download"
#: dontpanic/utils.py:330
msgid "Series"
msgstr ""
#: dontpanic.py:672
msgid "Torrent deleted"
#: dontpanic/utils.py:331
msgid "Search Results"
msgstr ""
#: dontpanic.py:687
msgid "If your browser doesn't support the player above, you may want to : "
#: dontpanic/utils.py:332
msgid "See also"
msgstr ""
#: dontpanic.py:690
msgid "Play with external video player"
#: dontpanic/utils.py:333
msgid "Director: "
msgstr ""
#: dontpanic.py:691
msgid "Download the video"
#: dontpanic/utils.py:334
msgid "Writers: "
msgstr ""
#: dontpanic.py:719
msgid "Look for subtitles on"
#: dontpanic/utils.py:335
msgid "Actors: "
msgstr ""
#: dontpanic.py:725
msgid "Choose a language to download subtitle"
#: dontpanic/utils.py:336
msgid "Subtitle (or any extra words):"
msgstr ""
#: dontpanic.py:734
msgid "No subtitle available on subdb"
#: dontpanic/utils.py:337
msgid "Search on:"
msgstr ""
#: dontpanic.py:749
msgid "Success: your subtitles are in the torrent folder"
#: dontpanic/utils.py:338
msgid "Watch now"
msgstr ""
#: dontpanic.py:751
msgid "Click here if you want to download them on you computer"
#: dontpanic/utils.py:339
msgid "Provided by"
msgstr ""
#: dontpanic.py:752
msgid "You may now close this page"
#: dontpanic/utils.py:340
msgid "all"
msgstr ""
#: dontpanic.py:754
msgid "Failed to download subtitles"
#: dontpanic/utils.py:341
msgid "Search"
msgstr ""
#: dontpanic.py:756
msgid "Subtitles"
#: dontpanic/utils.py:342
msgid "clean"
msgstr ""
#: dontpanic.py:771
msgid "Only the administrator can see this page"
#: dontpanic/utils.py:343
msgid "Translate with google"
msgstr ""
#: dontpanic.py:800
msgid "Go to hell, take the highway. You are not the administrator."
#: dontpanic/utils.py:344
msgid ""
"At the moment you have seen nothing. Put yourself comfortable and try to "
"watch something!"
msgstr ""
#: dontpanic.py:829
msgid "Don't Panic is now off"
#: dontpanic/utils.py:346
msgid "Default search engine"
msgstr ""
#: dontpanic.py:829
msgid "See you soon"
#: dontpanic/utils.py:347
msgid "Proxy type"
msgstr ""
#: dontpanic.py:841
msgid ""
"Dontpanic is a free (as in 'freedom') python application to look for any "
"movie or serie and watch them in 'streaming'. It looks like Popcorn Time or "
"Torrents Time, but doesn't depend of a centralized api"
#: dontpanic/utils.py:348
msgid "Proxy hostname"
msgstr ""
#: dontpanic.py:846
msgid "This has been made by two independent developers who love free software"
#: dontpanic/utils.py:349
msgid "Proxy username"
msgstr ""
#: dontpanic.py:849
msgid "Version"
#: dontpanic/utils.py:350
msgid "Proxy password"
msgstr ""
#: dontpanic.py:981
#: dontpanic/utils.py:351
msgid ""
"Dontpanic is a python app to look for any movie or serie and watch them in "
"streaming. It looks like popcorntime, but doesn't depend of a centralized "
"api."
msgstr ""
#: dontpanic.py:986 dontpanic-server.py:65
msgid "Print version"
msgstr ""
#: dontpanic.py:987
msgid "Stream a magnet link"
"none : no proxy - socks4 : username is required - socks5 : username and "
"password are ignored - socks5_pw : username and password are send to the "
"proxy if necessary - http : http proxy, username and password are ignored - "
"http_pw : http proxy with username/password authentication - i2p_proxy : i2p "
"SAM proxy"
msgstr ""
#: utils.py:62
msgid "What do we watch tonight?"
#: dontpanic/utils.py:355
msgid ""
"These options let you configure a proxy to hide your ip. By default, all "
"data is encrypted with dontpanic, so this solution is faster than a VPN. "
"Note if you already have a VPN configured, the following is useless. See <a "
"href='http://www.libtorrent.org/reference-Settings.html#proxy-"
"settings'>here</a> for more information. You can find <a href='http://"
"proxylist.hidemyass.com/'>a list of free proxy here</a> or <a href='http://"
"www.samair.ru/proxy/'>here</a>."
msgstr ""
#: utils.py:63
msgid "Don't forget your towel"
#: dontpanic/utils.py:362
msgid "> Upgrade dontpanic"
msgstr ""
#: utils.py:64
msgid "Do you have pizza?"
#: dontpanic/webutils.py:223
msgid "Today"
msgstr ""
#: utils.py:65
msgid "Type and watch"
#: dontpanic/ui.py:55
msgid "Name"
msgstr ""
#: utils.py:66
msgid "Turn off the lights"
#: dontpanic/ui.py:56
msgid "Size"
msgstr ""
#: utils.py:67
msgid "Get some beer before searching"
#: dontpanic/ui.py:57
msgid "Leechs"
msgstr ""
#: utils.py:286
msgid "About"
#: dontpanic/ui.py:58
msgid "Seeds"
msgstr ""
#: utils.py:287
msgid "Back to main page"
#: dontpanic/ui.py:92
msgid "More results"
msgstr ""
#: utils.py:288
msgid "Movie or serie title"
#: dontpanic/ui.py:95
msgid "There is no result for your search, try something else"
msgstr ""
#: utils.py:289
msgid "Best DVD's"
#: dontpanic/ui.py:132
msgid "Season"
msgstr ""
#: utils.py:290
msgid "Popular series"
#: dontpanic/ui.py:133
msgid "Episode"
msgstr ""
#: utils.py:291
msgid "Configuration"
#: dontpanic/ui.py:134 dontpanic/ui.py:275 dontpanic/ui.py:284
msgid "Title"
msgstr ""
#: utils.py:292
msgid "in cache"
#: dontpanic/ui.py:135
msgid "Release date"
msgstr ""
#: utils.py:293
msgid "Remove all finished torrents"
#: dontpanic/ui.py:136
msgid "Seen"
msgstr ""
#: utils.py:294
msgid "Show play link at"
#: dontpanic/ui.py:159
msgid "Yes"
msgstr ""
#: utils.py:295
msgid "Set upload limit in kB (-1 is no limit):"
#: dontpanic/ui.py:159
msgid "No"
msgstr ""