Skip to content

Commit

Permalink
Replace constants.py with config.cfg. Fix json path under meta/. Upda…
Browse files Browse the repository at this point in the history
…te tracker address of DIC
  • Loading branch information
soleil0-0 committed Jul 3, 2020
1 parent fa7856e commit 3479e7a
Show file tree
Hide file tree
Showing 11 changed files with 1,111 additions and 936 deletions.
190 changes: 99 additions & 91 deletions GazelleSync New GUI (not the final version) - EN.py
Original file line number Diff line number Diff line change
@@ -1,91 +1,99 @@
#!/usr/bin/env Python3
import PySimpleGUI as sg
import os
sg.ChangeLookAndFeel('DarkBlue')

layout = [

[sg.Text('GazelleSync 5.0.2 - DIC Variant', size=(30, 1), justification='center', font=("Helvetica", 25), relief=sg.RELIEF_RIDGE)],
[sg.Text('(Note: You should edit constants.py first, to include usernames and passwords of all relevant trackers)', font=("Helvetica", 8))],
[sg.Text('(Note: This .py should be in the same directory as the other .py files)', font=("Helvetica", 8))],
[sg.Text('From: ', font=("Helvetica", 15)), sg.InputCombo(('OPS', 'RED', 'NWCD', 'DIC'),key='_from_', default_value='none'), sg.Text('To :', font=("Helvetica", 15)), sg.InputCombo(('OPS', 'RED', 'NWCD', 'DIC'),key='_to_', default_value='none')],
[sg.Text('1) Fetch the torrent info from source tracker :', font=("Helvetica", 20))],
[sg.Text('Method A - using Source Tracker permalink', font=("Helvetica", 15))],
[sg.InputText(key='_permalink_')],
[sg.Text('The Source Tracker Permalink can be either of these two forms:', font=("Helvetica", 8))],
[sg.Text('https://source.tracker/torrents.php?id=1&torrentid=1#torrent1', font=("Helvetica", 8))],
[sg.Text('https://source.tracker/torrents.php?id=1&torrentid=1', font=("Helvetica", 8))],
[sg.Text('Method B - using Source Tracker .torrent file', font=("Helvetica", 15))],
[sg.Text('Choose a .torrent file', size=(15, 1), auto_size_text=False, justification='right'),
sg.InputText(key='_torrentFile_'), sg.FileBrowse(file_types=(("ALL Files", ".torrent"),))],
[sg.Text('Method C - using a folder of torrents', font=("Helvetica", 15))],
[sg.Text('Choose a folder', size=(15, 1), auto_size_text=False, justification='right'),
sg.InputText(key='_torrentFolder_'), sg.FolderBrowse()],
[sg.Text('2) Select the Music Folder(s)', font=("Helvetica", 20))],
[sg.InputCombo(('Single Mode', 'Bash Mode'), size=(20, 1), key='_singleOrBash_'),
sg.InputText(key='_musicFolder_'), sg.FolderBrowse()],
[sg.Text('Single Mode : Please browse to the directory that contains the actual music files', font=("Helvetica", 8))],
[sg.Text('Bash Mode : Please browse to the directory ABOVE your music directory (or directories)!', font=("Helvetica", 8))],
[sg.Text('_' * 80)],
[sg.Submit(button_text='Go! Go! Go! (Let\'s rip)', key='_goGo_'), sg.Exit(button_text='Exit')]
]


window = sg.Window('Gazelle -> Gazelle (5.0)', layout, default_element_size=(40, 1), grab_anywhere=False, icon="favicon.ico")

event, values = window.Read()

while True:
event, values = window.Read()
callMovePy = ''
if event == '_goGo_':
callMovePy = 'python move.py from=' + values['_from_'] + ' to=' + values['_to_']
if len(values['_permalink_']) > 0 :
callMovePy += ' link="' + values['_permalink_'] + '"'
elif len(values['_torrentFile_']) > 0:
callMovePy += ' tpath="' + values['_torrentFile_'] + '"'
elif len(values['_torrentFolder_']) >0:
callMovePy += ' tfolder="' + values['_torrentFolder_'] + '"'

if values['_singleOrBash_'] == 'Single Mode' :
callMovePy += ' album="' + values['_musicFolder_'] + '"'
elif values['_singleOrBash_'] == 'Bash Mode' :
callMovePy += ' folder="' + values['_musicFolder_'] + '"'
os.system(callMovePy)
elif event is None or event == 'Exit':
break
window.Close()


'''
if event == '_goGo_':
callMovePy = 'python move.py from=%(from) to=%(to)'
if len(values['_permalink_']) > 0 :
callMovePy += ' link="%(permalink)"'
elif len(values['_torrentFile_']) > 0:
callMovePy += ' tpath="%(torrentFile)"'
elif len(values['_torrentFolder_']) >0:
callMovePy += ' tpath="%(torrentFolder)"'
callMovePy = callMovePy + ' album="' + values['_musicFolder_'] + "\""
os.system(callMovePy % {'from' : values['_from_'],
'to': values['_to_'],
'permalink': values['_permalink_'],
'torrentFile': values['_torrentFile_'],
'torrentFolder': values['_torrentFolder_']})
'''

'''
if event == '_goGo_':
callMovePy = 'python move.py from=' + values['_from_'] + ' to=' + values['_to_']
if len(values['_permalink_']) > 0 :
callMovePy += ' link="' + values['_permalink_'] + '"'
elif len(values['_torrentFile_']) > 0:
callMovePy += ' tpath="' + values['_torrentFile_'] + '"'
elif len(values['_torrentFolder_']) >0:
callMovePy += ' tfolder="' + values['_torrentFolder_'] + '"'
callMovePy = callMovePy + ' album="' + values['_musicFolder_'] + '"'
os.system(callMovePy)
'''
#!/usr/bin/env Python3
import PySimpleGUI as sg
import os

def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)

move_cmd = "python move.py"
if is_exe("move.exe") or is_exe("move"):
move_cmd = os.path.join(".", "move")

sg.ChangeLookAndFeel('DarkBlue')

layout = [

[sg.Text('GazelleSync 5.0.2 - DIC Variant', size=(30, 1), justification='center', font=("Helvetica", 25), relief=sg.RELIEF_RIDGE)],
[sg.Text('(Note: You should edit config.cfg first, to include usernames and passwords of all relevant trackers)', font=("Helvetica", 8))],
[sg.Text('(Note: This .py should be in the same directory as the other .py files)', font=("Helvetica", 8))],
[sg.Text('From: ', font=("Helvetica", 15)), sg.InputCombo(('OPS', 'RED', 'NWCD', 'DIC'),key='_from_', default_value='none'), sg.Text('To :', font=("Helvetica", 15)), sg.InputCombo(('OPS', 'RED', 'NWCD', 'DIC'),key='_to_', default_value='none')],
[sg.Text('1) Fetch the torrent info from source tracker :', font=("Helvetica", 20))],
[sg.Text('Method A - using Source Tracker permalink', font=("Helvetica", 15))],
[sg.InputText(key='_permalink_')],
[sg.Text('The Source Tracker Permalink can be either of these two forms:', font=("Helvetica", 8))],
[sg.Text('https://source.tracker/torrents.php?id=1&torrentid=1#torrent1', font=("Helvetica", 8))],
[sg.Text('https://source.tracker/torrents.php?id=1&torrentid=1', font=("Helvetica", 8))],
[sg.Text('Method B - using Source Tracker .torrent file', font=("Helvetica", 15))],
[sg.Text('Choose a .torrent file', size=(15, 1), auto_size_text=False, justification='right'),
sg.InputText(key='_torrentFile_'), sg.FileBrowse(file_types=(("ALL Files", ".torrent"),))],
[sg.Text('Method C - using a folder of torrents', font=("Helvetica", 15))],
[sg.Text('Choose a folder', size=(15, 1), auto_size_text=False, justification='right'),
sg.InputText(key='_torrentFolder_'), sg.FolderBrowse()],
[sg.Text('2) Select the Music Folder(s)', font=("Helvetica", 20))],
[sg.InputCombo(('Single Mode', 'Bash Mode'), size=(20, 1), key='_singleOrBash_'),
sg.InputText(key='_musicFolder_'), sg.FolderBrowse()],
[sg.Text('Single Mode : Please browse to the directory that contains the actual music files', font=("Helvetica", 8))],
[sg.Text('Bash Mode : Please browse to the directory ABOVE your music directory (or directories)!', font=("Helvetica", 8))],
[sg.Text('_' * 80)],
[sg.Submit(button_text='Go! Go! Go! (Let\'s rip)', key='_goGo_'), sg.Exit(button_text='Exit')]
]


window = sg.Window('Gazelle -> Gazelle (5.0)', layout, default_element_size=(40, 1), grab_anywhere=False, icon="favicon.ico")

event, values = window.Read()

while True:
event, values = window.Read()
callMovePy = ''
if event == '_goGo_':
callMovePy = move_cmd + ' from=' + values['_from_'] + ' to=' + values['_to_']
if len(values['_permalink_']) > 0 :
callMovePy += ' link="' + values['_permalink_'] + '"'
elif len(values['_torrentFile_']) > 0:
callMovePy += ' tpath="' + values['_torrentFile_'] + '"'
elif len(values['_torrentFolder_']) >0:
callMovePy += ' tfolder="' + values['_torrentFolder_'] + '"'

if values['_singleOrBash_'] == 'Single Mode' :
callMovePy += ' album="' + values['_musicFolder_'] + '"'
elif values['_singleOrBash_'] == 'Bash Mode' :
callMovePy += ' folder="' + values['_musicFolder_'] + '"'
os.system(callMovePy)
elif event is None or event == 'Exit':
break
window.Close()


'''
if event == '_goGo_':
callMovePy = 'python move.py from=%(from) to=%(to)'
if len(values['_permalink_']) > 0 :
callMovePy += ' link="%(permalink)"'
elif len(values['_torrentFile_']) > 0:
callMovePy += ' tpath="%(torrentFile)"'
elif len(values['_torrentFolder_']) >0:
callMovePy += ' tpath="%(torrentFolder)"'
callMovePy = callMovePy + ' album="' + values['_musicFolder_'] + "\""
os.system(callMovePy % {'from' : values['_from_'],
'to': values['_to_'],
'permalink': values['_permalink_'],
'torrentFile': values['_torrentFile_'],
'torrentFolder': values['_torrentFolder_']})
'''

'''
if event == '_goGo_':
callMovePy = 'python move.py from=' + values['_from_'] + ' to=' + values['_to_']
if len(values['_permalink_']) > 0 :
callMovePy += ' link="' + values['_permalink_'] + '"'
elif len(values['_torrentFile_']) > 0:
callMovePy += ' tpath="' + values['_torrentFile_'] + '"'
elif len(values['_torrentFolder_']) >0:
callMovePy += ' tfolder="' + values['_torrentFolder_'] + '"'
callMovePy = callMovePy + ' album="' + values['_musicFolder_'] + '"'
os.system(callMovePy)
'''
126 changes: 65 additions & 61 deletions GazelleSync New GUI (not the final version) - ZH.py
Original file line number Diff line number Diff line change
@@ -1,61 +1,65 @@
#!/usr/bin/env Python3
import PySimpleGUI as sg
import os
sg.ChangeLookAndFeel('DarkBlue')





layout = [

[sg.Text('GazelleSync 5.0.2 - DIC Variant', size=(30, 1), justification='center', font=("Helvetica", 25), relief=sg.RELIEF_RIDGE)],
[sg.Text('(注意:首先,你需要编辑 constants.py,在其中添加所有相关站点的用户名和密码。)', font=("Times", 10))],
[sg.Text('(注意:本 .py 文件应与其他 .py 文件处于同一目录下。)', font=("Times", 10))],
[sg.Text('从:', font=("Times", 15)), sg.InputCombo(('OPS', 'RED', 'NWCD', 'DIC'),key='_from_', default_value='none'), sg.Text('到:', font=("Times", 15)), sg.InputCombo(('OPS', 'RED', 'NWCD', 'DIC'),key='_to_', default_value='none')],
[sg.Text('1) 从来源站点获取种子信息:', font=("Times", 20))],
[sg.Text('方法一:使用来源站点的种子永久链接(PL)', font=("Times", 15))],
[sg.InputText(key='_permalink_')],
[sg.Text('来源站点的种子永久链接可能存在以下两种形式:', font=("Times", 10))],
[sg.Text('https://source.tracker/torrents.php?id=1&torrentid=1#torrent1', font=("Times", 10))],
[sg.Text('https://source.tracker/torrents.php?id=1&torrentid=1', font=("Times", 10))],
[sg.Text('方法二:使用来源站点的种子文件', font=("Times", 15))],
[sg.Text('指定种子文件目录:', size=(15, 1), auto_size_text=False, justification='right'),
sg.InputText(key='_torrentFile_'), sg.FileBrowse(file_types=(("ALL Files", ".torrent"),))],
[sg.Text('方法三:使用一个包含种子文件的文件夹', font=("Times", 15))],
[sg.Text('指定文件夹目录:', size=(15, 1), auto_size_text=False, justification='right'),
sg.InputText(key='_torrentFolder_'), sg.FolderBrowse()],
[sg.Text('2) 指定音乐文件夹', font=("Times", 20))],
[sg.InputCombo(('单种模式', '批量模式'), size=(20, 1), key='_singleOrBash_'),
sg.InputText(key='_musicFolder_'), sg.FolderBrowse()],
[sg.Text('单种模式:请指定直接包含音乐文件的目录。', font=("Times", 10))],
[sg.Text('批量模式:请指定直接包含音乐文件目录的上层目录。', font=("Times", 10))],
[sg.Text('_' * 80)],
[sg.Submit(button_text='运行', key='_goGo_'), sg.Exit(button_text='退出', key='_exit_')]
]


window = sg.Window('Gazelle -> Gazelle (5.0)', layout, default_element_size=(40, 1), grab_anywhere=False, icon="favicon.ico")

event, values = window.Read()

while True:
event, values = window.Read()
callMovePy = ''
if event == '_goGo_':
callMovePy = 'python move.py from=' + values['_from_'] + ' to=' + values['_to_']
if len(values['_permalink_']) > 0 :
callMovePy += ' link="' + values['_permalink_'] + '"'
elif len(values['_torrentFile_']) > 0:
callMovePy += ' tpath="' + values['_torrentFile_'] + '"'
elif len(values['_torrentFolder_']) >0:
callMovePy += ' tfolder="' + values['_torrentFolder_'] + '"'

if values['_singleOrBash_'] == '单种模式' :
callMovePy += ' album="' + values['_musicFolder_'] + '"'
elif values['_singleOrBash_'] == '批量模式' :
callMovePy += ' folder="' + values['_musicFolder_'] + '"'
os.system(callMovePy)
elif event is None or event == '_exit_':
break
window.Close()
#!/usr/bin/env Python3
import PySimpleGUI as sg
import os

def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)

move_cmd = "python move.py"
if is_exe("move.exe") or is_exe("move"):
move_cmd = os.path.join(".", "move")

sg.ChangeLookAndFeel('DarkBlue')

layout = [

[sg.Text('GazelleSync 5.0.2 - DIC Variant', size=(30, 1), justification='center', font=("Helvetica", 25), relief=sg.RELIEF_RIDGE)],
[sg.Text('(注意:首先,你需要编辑 config.cfg,在其中添加所有相关站点的用户名和密码。)', font=("Times", 10))],
[sg.Text('(注意:本 .py 文件应与其他 .py 文件处于同一目录下。)', font=("Times", 10))],
[sg.Text('从:', font=("Times", 15)), sg.InputCombo(('OPS', 'RED', 'NWCD', 'DIC'),key='_from_', default_value='none'), sg.Text('到:', font=("Times", 15)), sg.InputCombo(('OPS', 'RED', 'NWCD', 'DIC'),key='_to_', default_value='none')],
[sg.Text('1) 从来源站点获取种子信息:', font=("Times", 20))],
[sg.Text('方法一:使用来源站点的种子永久链接(PL)', font=("Times", 15))],
[sg.InputText(key='_permalink_')],
[sg.Text('来源站点的种子永久链接可能存在以下两种形式:', font=("Times", 10))],
[sg.Text('https://source.tracker/torrents.php?id=1&torrentid=1#torrent1', font=("Times", 10))],
[sg.Text('https://source.tracker/torrents.php?id=1&torrentid=1', font=("Times", 10))],
[sg.Text('方法二:使用来源站点的种子文件', font=("Times", 15))],
[sg.Text('指定种子文件目录:', size=(15, 1), auto_size_text=False, justification='right'),
sg.InputText(key='_torrentFile_'), sg.FileBrowse(file_types=(("ALL Files", ".torrent"),))],
[sg.Text('方法三:使用一个包含种子文件的文件夹', font=("Times", 15))],
[sg.Text('指定文件夹目录:', size=(15, 1), auto_size_text=False, justification='right'),
sg.InputText(key='_torrentFolder_'), sg.FolderBrowse()],
[sg.Text('2) 指定音乐文件夹', font=("Times", 20))],
[sg.InputCombo(('单种模式', '批量模式'), size=(20, 1), key='_singleOrBash_'),
sg.InputText(key='_musicFolder_'), sg.FolderBrowse()],
[sg.Text('单种模式:请指定直接包含音乐文件的目录。', font=("Times", 10))],
[sg.Text('批量模式:请指定直接包含音乐文件目录的上层目录。', font=("Times", 10))],
[sg.Text('_' * 80)],
[sg.Submit(button_text='运行', key='_goGo_'), sg.Exit(button_text='退出', key='_exit_')]
]


window = sg.Window('Gazelle -> Gazelle (5.0)', layout, default_element_size=(40, 1), grab_anywhere=False, icon="favicon.ico")

event, values = window.Read()

while True:
event, values = window.Read()
callMovePy = ''
if event == '_goGo_':
callMovePy = move_cmd + ' from=' + values['_from_'] + ' to=' + values['_to_']
if len(values['_permalink_']) > 0 :
callMovePy += ' link="' + values['_permalink_'] + '"'
elif len(values['_torrentFile_']) > 0:
callMovePy += ' tpath="' + values['_torrentFile_'] + '"'
elif len(values['_torrentFolder_']) >0:
callMovePy += ' tfolder="' + values['_torrentFolder_'] + '"'

if values['_singleOrBash_'] == '单种模式' :
callMovePy += ' album="' + values['_musicFolder_'] + '"'
elif values['_singleOrBash_'] == '批量模式' :
callMovePy += ' folder="' + values['_musicFolder_'] + '"'
os.system(callMovePy)
elif event is None or event == '_exit_':
break
window.Close()
16 changes: 16 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[[source]]
name = "pypi"
url = "http://pypi.douban.com/simple"
verify_ssl = false

[dev-packages]
pyinstaller = "*"

[packages]
requests = "*"
mechanize = "*"
pysimplegui = "*"
configparser = "*"

[requires]
python_version = "3.7"
Loading

0 comments on commit 3479e7a

Please sign in to comment.