proxychains
This commit is contained in:
		
							parent
							
								
									aa095cd55c
								
							
						
					
					
						commit
						0627cb817f
					
				| @ -2,8 +2,7 @@ | |||||||
| FROM python:3.10 | FROM python:3.10 | ||||||
| WORKDIR /v6 | WORKDIR /v6 | ||||||
| ENV v6root=/v6data | ENV v6root=/v6data | ||||||
| RUN apt-get update | RUN apt-get update && apt-get install -y libopus0 opus-tools ffmpeg proxychains proxychains | ||||||
| RUN apt-get install -y libopus0 opus-tools ffmpeg |  | ||||||
| COPY base.requirements.txt base.requirements.txt | COPY base.requirements.txt base.requirements.txt | ||||||
| RUN pip install -r base.requirements.txt | RUN pip install -r base.requirements.txt | ||||||
| COPY requirements.txt requirements.txt | COPY requirements.txt requirements.txt | ||||||
| @ -13,4 +12,6 @@ ENV v6host=0.0.0.0 | |||||||
| RUN mkdir ${v6root} | RUN mkdir ${v6root} | ||||||
| COPY v6d3music v6d3music | COPY v6d3music v6d3music | ||||||
| RUN python3 -m v6d3music.main | RUN python3 -m v6d3music.main | ||||||
| CMD ["python3", "-m", "v6d3music.run-bot"] | COPY proxychains.conf /etc/proxychains.conf | ||||||
|  | COPY entrypoint.sh /entrypoint.sh | ||||||
|  | CMD ["/entrypoint.sh"] | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								entrypoint.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										5
									
								
								entrypoint.sh
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | #!/bin/sh | ||||||
|  | set -e | ||||||
|  | byedpi=$(dig +short byedpi) | ||||||
|  | sed -i -e 's/byedpi/'$byedpi'/g' /etc/proxychains.conf | ||||||
|  | exec python3 -m v6d3music.run-bot | ||||||
							
								
								
									
										9
									
								
								proxychains.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								proxychains.conf
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | |||||||
|  | quiet_mode | ||||||
|  | strict_chain | ||||||
|  | proxy_dns  | ||||||
|  | 
 | ||||||
|  | tcp_read_time_out 15000 | ||||||
|  | tcp_connect_time_out 8000 | ||||||
|  | 
 | ||||||
|  | [ProxyList] | ||||||
|  | socks4  byedpi 1080 | ||||||
| @ -14,23 +14,23 @@ __all__ = ("FFmpegNormalAudio",) | |||||||
| class FFmpegNormalAudio(discord.FFmpegAudio): | class FFmpegNormalAudio(discord.FFmpegAudio): | ||||||
|     def __init__( |     def __init__( | ||||||
|         self, |         self, | ||||||
|         source, |         source: str, | ||||||
|         *, |         *, | ||||||
|         executable="ffmpeg", |  | ||||||
|         pipe=False, |  | ||||||
|         stderr=None, |         stderr=None, | ||||||
|         before_options=None, |         before_options=None, | ||||||
|         options=None, |         options=None, | ||||||
|     ): |     ): | ||||||
|  |         internal = source.startswith("http://adaas:5000/cachedx/") | ||||||
|  |         executable = "ffmpeg" if internal else "proxychains" | ||||||
|         self.source = source |         self.source = source | ||||||
|         args = [] |         args = [] if internal else ["ffmpeg"] | ||||||
|         subprocess_kwargs = {"stdin": source if pipe else subprocess.DEVNULL, "stderr": stderr} |         subprocess_kwargs = {"stdin": subprocess.DEVNULL, "stderr": stderr} | ||||||
| 
 | 
 | ||||||
|         if isinstance(before_options, str): |         if isinstance(before_options, str): | ||||||
|             args.extend(shlex.split(before_options)) |             args.extend(shlex.split(before_options)) | ||||||
| 
 | 
 | ||||||
|         args.append("-i") |         args.append("-i") | ||||||
|         args.append("-" if pipe else source) |         args.append(source) | ||||||
|         args.extend(("-f", "s16le", "-ar", "48000", "-ac", "2", "-loglevel", "warning")) |         args.extend(("-f", "s16le", "-ar", "48000", "-ac", "2", "-loglevel", "warning")) | ||||||
| 
 | 
 | ||||||
|         if isinstance(options, str): |         if isinstance(options, str): | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user