Update rid
Changed wget to curl Added useragent
This commit is contained in:
		
							parent
							
								
									f1b7bb1e07
								
							
						
					
					
						commit
						42dd8a93c8
					
				
					 1 changed files with 68 additions and 64 deletions
				
			
		
							
								
								
									
										10
									
								
								rid
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								rid
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,7 +1,10 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
#
 | 
			
		||||
#https://github.com/dbeley/rid/blob/master/rid
 | 
			
		||||
# rid - Reddit Image Downloader - Simple bash script to download images from a subreddit.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
useragent="Love by u/gadelat"
 | 
			
		||||
timeout=60
 | 
			
		||||
 | 
			
		||||
usage() { printf "%s" "\
 | 
			
		||||
| 
						 | 
				
			
			@ -32,8 +35,9 @@ if [ -z $number ]; then
 | 
			
		|||
	number=200
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
url="https://www.reddit.com/r/$subreddit/$sort/.json?raw_json=1&t=$top_time"
 | 
			
		||||
content=$(wget -T $timeout -q -O - $url)
 | 
			
		||||
content=`curl -H "User-Agent: $useragent" $url`
 | 
			
		||||
mkdir -p $subreddit
 | 
			
		||||
i=1
 | 
			
		||||
while : ; do
 | 
			
		||||
| 
						 | 
				
			
			@ -60,5 +64,5 @@ while : ; do
 | 
			
		|||
        break
 | 
			
		||||
    fi
 | 
			
		||||
    url="https://www.reddit.com/r/$subreddit/$sort/.json?count=200&after=$after&raw_json=1&t=$top_time"
 | 
			
		||||
    content=`wget -T $timeout --no-check-certificate -q -O - $url`
 | 
			
		||||
    content=`curl -H "User-Agent: $useragent" $url`
 | 
			
		||||
done
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue