Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#461 closed Enhancement (fixed)

Readd Scrape Function to Cli

Reported by: Danez Owned by: somebody
Priority: Lowest Milestone: 1.00
Component: CLI Version: 0.92
Severity: Minor Keywords:
Cc: danez@…

Description

the option -s was deleted between 0.7 and 0.8.

We from torrentflux-b4rt would like to see that feature again as we use it to display a chart of this data.

I don't know if it is possibly atm in general and if there are functions in the core for this task.

Attachments (1)

cli-t461.diff (5.3 KB) - added by tiennou 14 years ago.
Corrected patch (as per Danez head up on it ;-)). Also tweak the output, so that it shows % done and % found while checking a file.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 14 years ago by Danez

thats amazing! thanks a lot.

But I think the scrape-block needs to look like this, i tested it and it works:

 if( showScrape )
     {   
        printf( "Scraping, Please wait...\n" );
        const tr_stat * stats;
        
        uint64_t start = tr_date();
        
        do
         {
            stats = tr_torrentStat( tor );
            if( stats == NULL || tr_date() - start > 20000 )
            {
                printf( "Scrape failed.\n" );
                goto cleanup;
            }
            tr_wait( 2 );
         }
         while( stats->completedFromTracker == -1 || stats->leechers == -1 || stats->seeders == -1 );
        
        printf( "%d seeder(s), %d leecher(s), %d download(s).\n",
            stats->seeders, stats->leechers, stats->completedFromTracker );

         goto cleanup;
     }

Changed 14 years ago by tiennou

Corrected patch (as per Danez head up on it ;-)). Also tweak the output, so that it shows % done and % found while checking a file.

comment:2 Changed 14 years ago by charles

  • Resolution set to fixed
  • Status changed from new to closed

Committed to trunk in r3810

comment:3 Changed 14 years ago by charles

  • Component changed from Transmission to CLI

comment:4 Changed 14 years ago by charles

  • Milestone changed from None Set to 1.00
Note: See TracTickets for help on using tickets.