Giter Site home page Giter Site logo

instantshare / instantshare Goto Github PK

View Code? Open in Web Editor NEW
7.0 6.0 0.0 499 KB

Tool for taking screenshots and instantly sharing them to a number of services

License: GNU General Public License v2.0

Python 98.73% HTML 1.27%
utility sharing cross-platform-desktop desktop-app desktop-application screenshot

instantshare's Introduction

instantshare

Instantshare allows you to create media on the fly and upload them to Imgur, Dropbox, Google Drive, ownCloud or even your own server (using SFTP). As soon as the upload is done, the public URL will be copied to your clipboard and you will get a notification to let you know that you can start sharing your screenshot, paste, voice message or regular file with your friends!

Online storage providers possibly to be added in the future:

  • FTP Servers
  • Nextcloud
  • ... submit your favorite storage provider request via issue or implementation via pull request!

At a later point, we would also like to enable you to share video recorded from your desktop (possibly WebM).

If you find any bugs or if you feel like you've got something helpful to add, you are welcome to contact us on the issue tracker.

Installation

At this point, the supported platforms are Microsoft Windows and GNU/Linux. We might consider adding Mac OSX support at some point in the future.

Currently, we do not ship any binaries or packages, but you can download and extract the sources. Or just clone the repository to any directory using

Windows

  • Download and install Python 3.5
  • During installation, it is recommended to add Python to your PATH
  • Install the dependencies using pip:
> pip install -r requirements-windows.txt

Linux

  • Python 3.5 (python) and pip (python-pip) should come with your distro
  • If not, install them using your package manager
  • Install using your distro's package manager: gnome-screenshot xclip python-tk
  • Install the dependencies using pip:

Optional: Build an executable file

We use PyInstaller for building the app into an executable file. We already provide a PyInstaller specification file, so building comes down to the following steps:

  • Install PyInstaller using pip
  • Run PyInstaller with the provided specification file in project root directory

PyInstaller creates a build directory containing temporary files and a dist directory containing the executable application.

Run the app

If you build the app beforehand, running the app is as simple as running the executable file in the new dist folder. If you skipped the optional build, you can still run the app like this:

> python C:\path\to\src\instantshare

on Windows or

on Linux, replacing the path with the actual location of the file.

Contributing

If you want to help, feel free to create a pull request. Please coordinate your efforts with us first though!

If you don't know much about coding, you can still help. Just visit the issue tracker and let us know of your ideas!

instantshare's People

Contributors

denniseffing avatar dtext avatar florianluediger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

instantshare's Issues

Recording of GIFs or WEBMs

You should be able to select a part of the screen and record a video of it which gets converted to the GIF or WEBM format for sharing.

Considerations:

  • GIF vs. WEBM
  • How does the user interaction work? -> How to start/stop the recording?
  • Include recordings of the webcam?

Update Tray menu and hotkeys to support new options

Currently, the windows tray menu and hotkeys can only be used to take screenshots. When #34 is merged, we should update those to support all the new options. Also, that could be a great opportunity to do some refactoring. At least for the tray menu, new entries require changes in many places, which is not ideal.

Integrate persistent data encryption

We want to be able to encrypt persistent data like access tokens or credentials.

In pull request #21, encryption was already implemented. We just need to integrate it, considering the following use cases:

  • Enter password everytime instantshare runs, maximum security. For entering the password, we would need a little popup window, this can be done in QT (pyqt), GTK (pygtk) or TK (tkinter).
  • Use the system keyring to store the password for encryption. The keyring can be implemented using the cross platform keyring package.
  • This should be configurable in the config file

Edit: Updated task list

Update setup.py

Currently, we don't really need setup.py for anything, so it's not up to date with our requirements.
As soon as we decide to do use it for distribution, we need to update it (with issue #26 in mind).

Possible solution can be found here.

Create installation routine

At the moment you have to install python with all dependencies yourself and run the software manually. An installer would be nice which delivers an executable out of the box.

Graphical User Interface

As most things happen in the background, we luckily don't need much of a GUI. For a start anyways.
But we do need some simple dialogues to prompt the user for input.

Eventually, a graphical configuration tool for all of instantshare's settings would be nice, as I imagine there to be many of them at one point.

This issue is intended as a long running issue, where we can track the progress of these features. I would only consider this closed when the all the listed features are implemented.

To do

  • Decide on cross platform GUI toolkit [1]
  • Implement a simple "Login" Dialog
  • Implement a password-only prompt
  • Implement a cross platform tray icon to replace the existing one [2]

Related

  • Port hotkey functionality over to Linux [3]

In the future:

  • Create configuration dialog [4]

Notes

[1] We were leaning towards using QT before, GTK might also be an option. We could decide to keep it simple and use tkinter, the de facto standard for python GUIs, but that one is objectively ugly. There are also crazy experiments out there with Electron (Desktop toolkit using JavaScript, HTML and CSS) + python, but solutions like that are a bit over the top for our needs, I think.

[2] We don't have to use the GUI toolkit of choice for that, although that might be the easiest thing. I found this cross platform tray library, which seems to be actively developed and quite well written (at least on first look). It could be a viable alternative if we chose to stick with tkinter for a start, as that does not provide easy tray access.

[3] There are libraries for this, just not widely used ones. We could also consider to have a "hotkey daemon" independant of the tray there (implemented as a system service; users are generally more familiar with that concept). But then again, that might not be all that useful, as hotkeys can easily be mapped to commands.

[4] We should do that when a big part of the intended features is done; otherwise we will probably end up redoing it over and over again. Making it generic and extensible would introduce a degree of complexity that is probably way too high for this project.

Error Handling and Logging

After Milestone 0.2, we should rethink error handling and logging inside the storage providers. They also need to be resilient in the face of failure. For example, errors we don't anticipate are:

  • no internet connection
  • unsupported media type for hoster
  • upload failed for some other reason
  • API change
  • ...

If I call an upload(file) method, I expect an error to be raised when that method does not complete successfully. That error could then be handled by me, the individual storage providers don't need to be concerned about how to inform the user about errors.

There was a change a while back where the storage provider's functionality was moved up to the module level for the sake of simplicity. Now I think it could be better to think about storage providers as classes with state again. I believe that would make them more maintainable.

p.s.: This is labeled as a bug because the any of the listed errors has the potential to crash the storage provider modules.

Stuck when trying to take a screenshot

I can't reliably reproduce this, and I'm not sure what is responsible for this, but under certain circumstances, taking a screenshot gets me stuck in Line 79 in windows_tk.py.

Ideas after talking to @denniseffing about this:
Maybe the TK Window is in the background somehow?

It seems that it only happens once and fixes itself the second time when running in tray mode, but when I executed instantshare screen and got this issue, it persisted until I ran it in tray mode once.
That run was also when #38 occured, so maybe this is linked somehow? No idea.

Fix inconsistency with directories on the storage providers

At the moment we have the following situation:

SFTP: The user specifies a base_dir(e.g. share) which is the directory that contains the screenshot_dir(e.g. screenshots) which is also user specified. If the base_dirdoes not exist in the remote root directory, the program exits with an error. However, if the screenshot_dirdoes not exist, it gets created automatically.

Google Drive and Dropbox: These implementations completely lack the base_dir configuration option and only use the screenshot_dir entry. The screenshot_dir gets created automatically if not present in the remote directory.

Suggestion to make the behavior consistent:

Remove the screenshot_dir (as well as audio_dir, ...) configuration options and only keep the base_dir option. This directory should not be created automatically for the user so things like the SFTP implementation don't need write-permissions in the root directory on the remote. The base directory should then contain automatically created sub-directories like screenshots, audio, text, other,... to organize the different file types.

Opinions?

Improve Config Parser implementation

As discovered in #21, the current config parser implementation is problematic.
The creation of the single CONFIG instance leads to problems with logging. It would also improve the code quality to not use a singleton here.

Tray Menu Crash

After taking a cropped screenshot, the screenshot was uploaded, but then the tray menu crashed.

Relevant Part of the stack trace:

  File "C:/Users/dt/Projects/python/instantshare/src\cli\main.py", line 76, in main
    _execute_command(argv)
  File "C:/Users/dt/Projects/python/instantshare/src\cli\main.py", line 52, in _execute_command
    _get_module(argv[0]).main(argv)
  File "C:/Users/dt/Projects/python/instantshare/src\cli\gui.py", line 63, in main
    event()
TypeError: 'NoneType' object is not callable

Somehow, None must have ended up in the event queue from somewhere.
This happened with the imgur storage provider enabled, but that does not seem to be related to this.

Edit: as mentioned in #39, this occurred after I had that other issue and ran instantshare tray to work around that.

Improve Logging Options

As @denniseffing proposed in #36, we should change the default logging settings:

Logging to file should be on by default or atleast be configurable (and the config option should be turned on by default). This would make it easier to report crash reports for users who only use the gui option (and can not see the stracktrace in the commandline).

I would maybe add the following things to that:

  • add the option to turn off logging completely
  • make it configurable via command line, so users can easily run it once with logging turned on, while having it turned off in general

URL Shortener Support

I suggest we add optional URL shortening using multiple URL shorteners like goo.gl (Documentation) or tinyurl (Documentation, if you can call it that). bit.ly seems to overengineer things a bit for a URL Shortener.

We could add a setting called url_shortener. Leaving it empty or setting it to None would deactivate the feature, any other value would be used to load a module or call a function.

Notification when upload is finished

At the moment you don't know when the upload finished and the link is copied to the clipboard, so a notification should be added.

To Do:

  • Acoustic Notifications
  • Notification Popups

Work out a concept for OAuth

As everyone uses OAuth now, we need to work out a concept that fulfills the following requirements:

  • provides a simple OAuth flow for the user
  • is more or less secure from our standpoint (so malicious software can not impersonate our app)
  • can be used with most (preferably all) of the storage providers

The main problem is that the client/app secret needs to be kept secret, and to my understanding, the only way to achieve this on a client's machine without tying the secret to a user account and encrypting it is security through obscurity.

The implicit flow may be a way to start here. There are already some experiments with that here: 329bd26.

Make tools/audio.py more generic

The tools package is intended for reusable code. Thus, we should avoid coupling with functionality that is specific to another part of our app.

I suggest we create a small function like play_wave_audio(path: str) instead of play_notification(). In fact, we could even put that function in toolbox.py (which is for rather small code snippets) instead of using a whole seperate module just for that.

Better handling of config file and persistent data

Ideally, we want to separate the instantshare.conf file from persisted data like access tokens.
A config file is not a generic data store. Also the file should only be read from, so we can put comments to explain some of the options. These comments will be lost when saving to that file, at least using the config parser module python provides.
We could try to implement a better version of that (i.e. add support for retaining comments), but really, we should seperate these two kinds of data.

Do we want a solution to this in 0.1?

Set a default value for the screenshot_tool variable

Currently, instantshare does not work out of the box.

See the TODO here: 0480023

For a start it could be a simple OS check, but eventually we need something fancier than that, if we want to support modular backends for taking screenshots. A possible way to do this is: If the screenshot_tool option is not set, we try out all available tools and put the first one that works.

Create CLI

We should look into creating a command line interface similar to git:

instantshare screen to take a screenshot with default settings
instantshare screen --whole to take a screenshot of the whole screen
instantshare text to share text from the clipboard
...

These functions should be seperated into distinct modules.

Trayicon not responding after "denying" or closing imgur access

If I use the trayicon to share something and imgur opens up, instantshare crashes if I simply close the tab or press "deny". No function is responding on the trayicon.

Steps to reproduce this issue:

  1. Run python <path>\src\instantshare gui
  2. Capture a screenshot using the trayicon
  3. Press "deny" on the opening imgur tab in the browser

Record and upload sound

It would be cool to be able to share little audio snippets.

Considerations:

  • microphone recordings
  • recording of the computer for music sharing, ....
  • how to switch between these two

Fix Dropbox Links

The links provided by Dropbox seem to only work for a couple of hours and expire after that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.