webmock icon indicating copy to clipboard operation
webmock copied to clipboard

Webmock not able disable net connection for shell commands

Open wonderer007 opened this issue 4 years ago • 3 comments

Using webmock with youtube-dl gem I found out that disable internet connection isn't working. After some debugging, I found that `youtube-dl gem is using the command line library to make an HTTP request. Is there any way I can disable the internet for command-line requests as well?

For example, web mock works well for the below command

Typhoeus.get('https://www.youtube.com/watch?v=OWp6vSHFG4M').body

But for this command it never worked

YoutubeDL::Video.new('https://www.youtube.com/watch?v=OWp6vSHFG4M').information

YoutubeDL internaly using terrapin gem.

wonderer007 avatar May 12 '21 01:05 wonderer007

@wonderer007 as far as I can see, YoutubeDL is a Python library, not Ruby. WebMock only supports Ruby.

bblimke avatar May 12 '21 13:05 bblimke

@wonderer007 as far as I can see, YoutubeDL is a Python library, not Ruby. WebMock only supports Ruby.

I am using Ruby wrapper for youtube-dl

wonderer007 avatar Sep 20 '21 01:09 wonderer007

@wonderer007 ok, then the request is made from Python library right? Ruby just invokes Python lib.

bblimke avatar Sep 30 '21 18:09 bblimke