Example #1
0
    def get(self, request):

        url = request.GET.get('url')
        name = request.GET.get('name')

        downloader = DownloadManager(settings.DOWNLOAD_ROOT, settings.PIDFILE_FILENAME, settings.ARIA2_CONF_FILENAME)
        downloader.launch_if_required()
        gid = downloader.add_download(url)

        sync_downloads()

        from django.contrib import messages
        messages.success(request, "Successfully added '%s'." % name)

        return HttpResponseRedirect(redirect_to='/search/')
Example #2
0
    def get_context_data(self, **kwargs):
        context = super(DownloadItemsView, self).get_context_data(**kwargs)

        sync_downloads()

        return context