Block youtube without block google drive - youtube

I want to block youtube.com. I use mikrotik. I can block youtube with Layer7 protocols with this regexp : ^.*(youtube.com).*$
but if I apply this filter, I also can not access google drive. Can I block youtube but still can access to google drive?

if you use router as main dns server for you lan just rewrite youtube addresses
/ip dns static add regexp="youtube.com*" address=127.0.0.1
/ip dns static add regexp="youtu.be*" address=127.0.0.1

Finally I can block by this filter
^.+(googlevideo.com|videoplayback).*$
User still can access youtube.com but the video will not loaded

Related

Can you change the public URL of a file on Google Cloud Storage?

I'm storing a series of html files in a GCP bucket, and want to share a minified link for social media purposes. Trouble is, the minified link contains the full-length Public URL for redirection purposes, so at the moment the storage.googleapis.com url shows up on those social media cards.
Ideally I'd like it to show the minified url, but at the very least I'd like to change the Public URL in GCP to something more human-accessible.
You have 2 ways to serve a website from Cloud Storage and to customize the URL.
First, if you want to serve your traffic ONLY in HTTP, you can follow this part of the documentation. It
Second, if you want to serve in HTTPS (and optionally also in HTTP) you need a LoadBalancer. The documentation explains the set up.
So when you're setting up you your domain you can use a CNAME record to point to redirect to google bucket
this answers it pretty clearly - https://stackoverflow.com/a/18650641/6147146

How to find out what my live stream URL is?

I am trying to stream from obs or similar to maybe restream, but I also want to send the feed to a custom RTMP player on my site, it's asking for the Live Streaming URL. How can I find that?
I believe obs asks you to connect to a streaming platform (I think this is what you meant by "restream"). Depending on the platform you are streaming to (Twitch, Youtube, etc), then you would need to get the URL from that site. Connect to one of these first and it should give you a URL. I think YouTube requires 24 hours to enable live streaming.
If you can stream directly to your website I am not aware of it. Reason being, in most cases you have a dynamic IP or port that is not open for your website to view the original stream from your Obs software/computer.

Can not access images after convert their address from host to ip address

Here is the situation. On the iOS, I used NSURLProtocol to intercept every single request from the webview. I was trying to intercept requests from a H5 page, so I can get requests of elements in the page, like images, js or css. Then I need to manipulate those links, the purpose is to avoid DNS spoofing.
To do so, I convert image request url format to IP address format. Take Google as example, The logo has address: https://www.google.com.hk/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png.
After conversion, I got address start with Google's IP address, http://216.58.197.110/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png
In the Google's case, it is fine. I can load the image to the browser, however, It doesn't work in some other cases.
Here is another example, http://www.planwallpaper.com/static/images/i-should-buy-a-boat.jpg. The converted URL is http://104.24.127.96/static/images/i-should-buy-a-boat.jpg. Then this I got Direct IP access not allowed. I really think there are so many situations, like whether ports are open or not. Is a way to solve this?

What is elastic IP on Amazon EC2? is it okay if I don't use it?

I have hosted a RoR app on Amazon EC2 instance. Instance has public IP but no elastic IP is assigned. Application is pointed to a domain using Dreamhost.
We use Amazon S3 to store audio files uploaded through web application and load these files back to site and play in player.
This is where I am facing weird issue, sometimes files play fine but sometimes it gives error saying
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin http://XX.XXX.XX.XXX is therefore not allowed access.
But at the same time if I copy paste S3 url in browser outside my application it loads.
Why error gives IP address instead of saying mydoamin.com is therefore not allowed access?
I am guessing the issue is because of some domain/IP configurations.
An elastic IP on amazon is an IP which is reserved to you. Without it, every time you stop and start your instance, a different IP will be set to it.
You don't have to use elastic IP, you could, for example point your domain to an ELB (elastic load balancer) CNAME, which will remain constant as it load balances between one or more instances of your application.
I'm not sure this has anything to do with the error given, which is explained in this answer:
Site B uses Access-Control-Allow-Origin to tell the browser that the
content of this page is accessible to certain domains. By default,
site B's pages are not accessible to any other domain; using the ACAO
header opens a door for cross-domain access by specific domains.
Site B should serve its pages with
Access-Control-Allow-Origin: http://sitea.com
It seems that the problematic link is an absolute path with the explicit IP, I have no idea why this should happen, look at the source of the page from which the link fails, and try to figure it out.

Bandwidth Data implications of embedding Youtube videos in my website

If I embed a Youtube video on my web page, what are the data usage implications on my server?
I have a shared web hosting plan for my website with a data transfer limit of 5 GB/month. When a user plays video on my site, is my server taxed for data transfer i.e. if the video is of size 1GB, is my data transfer limit decreased by 1GB?
And is my server processor taxed for video streaming?
What other things should I be concerned about?
Is there any link you can point me towards? That will be helpful.
Thanks
Both the youtube player and the video content is streamed from Youtube's server. The only price you pay is the few bytes it takes to add the video player embed code in your HTML pages.
When you embed a YouTube video, it streams directly from YouTube's servers.
Your server is not involved.
When you insert youtube or any embed code in your html page, your server serves the html content to the user's web browser / client (technically means user's web browser). And this html content is processed and translated by the client/ user's web browser. This means that it is served by your server as a link, but when the client translates it, it becomes an action; an action to pull content from the somewhere. So the client (user's web browser pulls the video from the specified url embedded in the iframe. In turn, the bandwith been used are calculated from
In addition to what Etienne Perot said,
There are 3 nodes in play here, namely:
Your server
Youtube Servers
The Client (i.e the user accessing you website)
In simple words: embed is an html tag that allows you include a link to a resource. And since youtube's embed goes in the form of youtu.be/foo or youtube.com/foo. Your browser simply parses (processes the link) and gets the content from that link, thereby visiting youtube website (underground) to fetch the referenced link without going through your server nor anything like that.
Meanwhile when you insert youtube or any embed code in your html page, your server serves the html content to the visitor's web browser / client (technically means visitor's web browser). And this html content is processed and translated by the client / user's web browser.
This means that it is served by your server as a link, but when the client translates it, it becomes an action; an action to pull content from the somewhere. So the client (user's web browser pulls the video from the specified url embedded in the iframe.
In turn, the bandwith been used are calculated from
The client (i.e the bandwidth used to access in the internet and the video's url) - calculated or billed by your ISP from your data active subscription.
Youtube's Server (i.e the bandwidth from the server that serves the content being streamed) - calculated or billed by google cloud service from their inhouse cloud resource allocation.
If you use the google chrome browser, you can check this our by right clicking on the video and clicking inspect element, then switching to the network tab; you might have to hit refresh so that the page tries to get all the content loaded all over again: the purpose of this is to see where the content is loaded from.
See Network Analysis Reference on how to use the network tab in google chrome developer tools. Mozilla firefox and some named browsers also have the inspect element and network monitor feature.
I hope this helps somebody.

Resources