8000 GitHub - stevarms/FileMover: A simple python script that sorts files in a folder based on file name
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

stevarms/FileMover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

FileMover

A simple python script that sorts files in a folder based on file name. Intended for use with telegram to auto sort files based on the filename but could be adapted to other purposes.

This code is a work in progress

How it works

This script monitors a specified folder for new files, when a file is detected it waits until the file is moveable then it moves it to a different folder based on the filename. The program reads the filename and looks for certain keywords: monthly, kickstarter, trove, and warhammer+. If it finds a keyword it will split the filename at '-' or '_' characters to determine the name and date for the file. The file will then be moved into the sort folder with folder hierarchy based on the keyword (and possibly name). Anything that cant be sorted is put in a folder called unsorted.

E.G.

c:\input\monthly-code2-2022.01-building.zip

will be moved to

c:\output\monthly\code2\monthly-code2-2022.01-building.zip

c:\input\kickstarter-fantasyfootball.zip

will be moved to

c:\output\kickstarter\kickstarter-fantasyfootball.zip

c:\input\trove-creatorname-darkangelsstuff.zip

will be moved to

c:\output\trove\creatorname\trove-creatorname-darkangelsstuff.zip

c:\input\icantnamethingscorrectly.png

will be moved to

c:\output\unsorted\icantnamethingscorrectly.png

Getting Started

  1. install python 3
  2. update pip py -m pip install --upgrade pip
  3. install the watchdog package with pip py -m pip install watchdog
  4. install the pyautogui package with pip py -m pip install pyautogui
  5. edit the script mover.py (you can just open with notepad or a code editor like vscode or notepad++)
    • set the watch_path (this should be your telegram download path)
    • set the target_path (this is where you want the mover to put the files, it will create sorted subdirectories)
    • set enable_autscroller to False if you dont want the script to scroll your Telegram for you.
  6. setup telegram to auto download
    • settings -> advanced -> download path -> custom folder (this will be the same as watch_path above)
    • settings -> advanced -> manage local storage -> increase the total size limit & cache limit to 10GB
    • settings -> advanced -> In Groups -> increase Limit by Size to 2000MB also make sure files and photos are checked
  7. run mover.py (either by double clicking or open a cmd window and navigate to the location)

Known issues

  • the multithreadding doesnt really work
  • This likely wont work on mac or linux

Planned Features

  • auto scroll for telegram

About

A simple python script that sorts files in a folder based on file name

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0