Refine ookla-speedtest hosts generation script using Perl
This commit is contained in:
		
							
								
								
									
										5
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							@@ -34,10 +34,7 @@ jobs:
 | 
			
		||||
      - name: Automatically generate ookla-speedtest sub-list from source
 | 
			
		||||
        run: |
 | 
			
		||||
          curl -L -o servers-source.xml "https://c.speedtest.net/speedtest-servers-static.php"
 | 
			
		||||
          cat servers-source.xml | sed -nEe 's/.+host="(.+):[0-9]+".+/\L\1/p' | sort -u > hosts-with-ip.txt
 | 
			
		||||
          sed -E '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/d' hosts-with-ip.txt > hosts-without-ip.txt
 | 
			
		||||
          cat hosts-without-ip.txt | awk '{printf "full:%s\n", $0}' > $GOPATH/src/$REPO_URL/data/ookla-speedtest
 | 
			
		||||
          echo "include:ookla-speedtest-ads" >> $GOPATH/src/$REPO_URL/data/ookla-speedtest
 | 
			
		||||
          perl -ne '/host="(.+):[0-9]+"/ && print "full:$1\n"' servers-source.xml | perl -ne 'print if not /^(full:([0-9]{1,3}\.){3}[0-9]{1,3})$/' | perl -ne 'print lc' | sort --ignore-case -u >> $GOPATH/src/$REPO_URL/data/ookla-speedtest
 | 
			
		||||
 | 
			
		||||
      - name: Build geosite.dat file
 | 
			
		||||
        run: |
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user